aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check-queries.lua
diff options
context:
space:
mode:
authorDundar Göc <gocdundar@gmail.com>2022-01-31 21:45:56 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-01-31 23:05:51 +0100
commit6799824f6b9b9185622e79cda7eebb03c6f6ac15 (patch)
treef80528d9ef16fcd8756a42e5a6fa73e63fb9f0a1 /scripts/check-queries.lua
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar.gz
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar.bz2
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar.lz
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar.xz
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.tar.zst
nvim-treesitter-6799824f6b9b9185622e79cda7eebb03c6f6ac15.zip
ci: skip swift check on neovim stable
This is meant as a temporary workaround until neovim 0.7 is released. More context: https://github.com/nvim-treesitter/nvim-treesitter/issues/2313#issuecomment-1025258357
Diffstat (limited to 'scripts/check-queries.lua')
-rwxr-xr-xscripts/check-queries.lua48
1 files changed, 26 insertions, 22 deletions
diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua
index 3ffba64e5..1cda6913e 100755
--- a/scripts/check-queries.lua
+++ b/scripts/check-queries.lua
@@ -44,28 +44,32 @@ local function do_check()
io_print "::group::Check parsers"
for _, lang in pairs(parsers) do
- timings[lang] = {}
- for _, query_type in pairs(query_types) do
- local before = vim.loop.hrtime()
- local ok, query = pcall(queries.get_query, lang, query_type)
- local after = vim.loop.hrtime()
- local duration = after - before
- table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
- io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
- if not ok then
- vim.api.nvim_err_writeln(query)
- last_error = query
- else
- if query then
- for _, capture in ipairs(query.captures) do
- local is_valid = (
- vim.startswith(capture, "_") -- Helpers.
- or vim.tbl_contains(captures[query_type], capture)
- )
- if not is_valid then
- local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
- io_print(error)
- last_error = error
+ -- NOTE: this is a temporary workaround to skip swift tests on ubuntu
+ -- stable and should be removed once neovim 0.7 is released.
+ if vim.fn.getenv "SKIP_SWIFT_CHECK" == vim.NIL or lang ~= "swift" then
+ timings[lang] = {}
+ for _, query_type in pairs(query_types) do
+ local before = vim.loop.hrtime()
+ local ok, query = pcall(queries.get_query, lang, query_type)
+ local after = vim.loop.hrtime()
+ local duration = after - before
+ table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
+ io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
+ if not ok then
+ vim.api.nvim_err_writeln(query)
+ last_error = query
+ else
+ if query then
+ for _, capture in ipairs(query.captures) do
+ local is_valid = (
+ vim.startswith(capture, "_") -- Helpers.
+ or vim.tbl_contains(captures[query_type], capture)
+ )
+ if not is_valid then
+ local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
+ io_print(error)
+ last_error = error
+ end
end
end
end