mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 02:40:09 -04:00
Allow multiple errors in CI
This commit is contained in:
parent
e32029460d
commit
9b6b2543e8
2 changed files with 17 additions and 12 deletions
|
|
@ -134,9 +134,6 @@
|
||||||
"teal": {
|
"teal": {
|
||||||
"revision": "fc73205515276be4ff95dfc5daa0fc67e18bfbde"
|
"revision": "fc73205515276be4ff95dfc5daa0fc67e18bfbde"
|
||||||
},
|
},
|
||||||
"test": {
|
|
||||||
"revision": "b76dd0d07f66dac5abf4641cab7a1d6067039b7f"
|
|
||||||
},
|
|
||||||
"toml": {
|
"toml": {
|
||||||
"revision": "084da152d85cb8c4bbbe0ab5f3f1f9e5bfb77d3c"
|
"revision": "084da152d85cb8c4bbbe0ab5f3f1f9e5bfb77d3c"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -26,24 +26,32 @@ local function do_check()
|
||||||
local query_types = queries.built_in_query_groups
|
local query_types = queries.built_in_query_groups
|
||||||
|
|
||||||
local captures = extract_captures()
|
local captures = extract_captures()
|
||||||
|
local last_error
|
||||||
|
|
||||||
for _, lang in pairs(parsers) do
|
for _, lang in pairs(parsers) do
|
||||||
for _, query_type in pairs(query_types) do
|
for _, query_type in pairs(query_types) do
|
||||||
print('Checking '..lang..' '..query_type)
|
print('Checking '..lang..' '..query_type)
|
||||||
local query = queries.get_query(lang, query_type)
|
local ok, query = pcall(queries.get_query,lang, query_type)
|
||||||
|
if not ok then
|
||||||
if query then
|
vim.api.nvim_err_writeln(query)
|
||||||
for _, capture in ipairs(query.captures) do
|
last_error = query
|
||||||
if not vim.startswith(capture, "_") -- We ignore things like _helper
|
else
|
||||||
and captures[query_type]
|
if query then
|
||||||
and not capture:find("^[A-Z]") -- Highlight groups
|
for _, capture in ipairs(query.captures) do
|
||||||
and not vim.tbl_contains(captures[query_type], capture) then
|
if not vim.startswith(capture, "_") -- We ignore things like _helper
|
||||||
error(string.format("Invalid capture @%s in %s for %s.", capture, query_type, lang))
|
and captures[query_type]
|
||||||
|
and not capture:find("^[A-Z]") -- Highlight groups
|
||||||
|
and not vim.tbl_contains(captures[query_type], capture) then
|
||||||
|
error(string.format("Invalid capture @%s in %s for %s.", capture, query_type, lang))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if last_error then
|
||||||
|
error(last_error)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue