diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2021-03-04 13:56:40 +0100 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-03-16 18:52:43 +0100 |
| commit | 9b6b2543e88212ea9eafac6c6fd910ddd56cc445 (patch) | |
| tree | 72923a50a8c4cfafa617f99e7c76deacdca287df | |
| parent | CI: Remove JS hack (diff) | |
| download | nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar.gz nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar.bz2 nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar.lz nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar.xz nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.tar.zst nvim-treesitter-9b6b2543e88212ea9eafac6c6fd910ddd56cc445.zip | |
Allow multiple errors in CI
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rwxr-xr-x | scripts/check-queries.lua | 26 |
2 files changed, 17 insertions, 12 deletions
diff --git a/lockfile.json b/lockfile.json index d404323a2..1cf649941 100644 --- a/lockfile.json +++ b/lockfile.json @@ -134,9 +134,6 @@ "teal": { "revision": "fc73205515276be4ff95dfc5daa0fc67e18bfbde" }, - "test": { - "revision": "b76dd0d07f66dac5abf4641cab7a1d6067039b7f" - }, "toml": { "revision": "084da152d85cb8c4bbbe0ab5f3f1f9e5bfb77d3c" }, diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index aee0089e7..97960e323 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -26,24 +26,32 @@ local function do_check() local query_types = queries.built_in_query_groups local captures = extract_captures() + local last_error for _, lang in pairs(parsers) do for _, query_type in pairs(query_types) do print('Checking '..lang..' '..query_type) - local query = queries.get_query(lang, query_type) - - if query then - for _, capture in ipairs(query.captures) do - if not vim.startswith(capture, "_") -- We ignore things like _helper - 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)) + local ok, query = pcall(queries.get_query,lang, query_type) + if not ok then + vim.api.nvim_err_writeln(query) + last_error = query + else + if query then + for _, capture in ipairs(query.captures) do + if not vim.startswith(capture, "_") -- We ignore things like _helper + 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 + if last_error then + error(last_error) + end end |
