ci: renovate

This commit is contained in:
Christian Clason 2025-04-29 19:40:18 +02:00
parent b4aa6d9650
commit 0418c02ff3
17 changed files with 256 additions and 265 deletions

View file

@ -6,29 +6,6 @@ local configs = require('nvim-treesitter.parsers')
local parsers = #_G.arg > 0 and { unpack(_G.arg) }
or require('nvim-treesitter.config').installed_parsers()
-- Extract captures from documentation for validation
local captures = {} ---@type table[]
do
local current_query ---@type string
for line in io.lines('CONTRIBUTING.md') do
if vim.startswith(line, '### ') then
current_query = line:sub(5):lower() ---@type string
elseif vim.startswith(line, '@') and current_query then
if not captures[current_query] then
captures[current_query] = {}
end
table.insert(captures[current_query], vim.split(line:sub(2), ' ')[1])
end
end
-- Complete captures for injections.
for lang, _ in pairs(configs) do
table.insert(captures['injections'], lang)
end
end
-- Check queries for each installed parser in parsers
local errors = {} ---@type string[]
local timings = {} ---@type { duration: number, lang: string, query_type: string }[]
@ -46,19 +23,6 @@ do
print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6))
if not ok then
errors[#errors + 1] = string.format('%s (%s): %s', lang, query_type, query)
else
if query then
for _, capture in ipairs(query.captures) do
local is_valid = (
vim.startswith(capture, '_') -- Helpers.
or vim.list_contains(captures[query_type], capture)
)
if not is_valid then
errors[#errors + 1] =
string.format('%s (%s): invalid capture "@%s"', lang, query_type, capture)
end
end
end
end
end
end