style: fill in missing code docs wherever applicable

This commit is contained in:
Amaan Qureshi 2023-02-24 03:07:52 -05:00 committed by Stephan Seitz
parent fceb4ed0ec
commit 853b1ab39a
17 changed files with 431 additions and 191 deletions

View file

@ -1,4 +1,9 @@
-- Execute as `nvim --headless -c "luafile ./scripts/update-readme.lua"`
---@class Parser
---@field name string
---@field parser ParserInfo
local parsers = require("nvim-treesitter.parsers").get_parser_configs()
local sorted_parsers = {}
@ -6,12 +11,15 @@ for k, v in pairs(parsers) do
table.insert(sorted_parsers, { name = k, parser = v })
end
---@param a Parser
---@param b Parser
table.sort(sorted_parsers, function(a, b)
return a.name < b.name
end)
local generated_text = ""
---@param v Parser
for _, v in ipairs(sorted_parsers) do
local link = "[" .. (v.parser.readme_name or v.name) .. "](" .. v.parser.install_info.url .. ")"
@ -41,7 +49,7 @@ local new_readme_text = string.gsub(
)
vim.fn.writefile(vim.fn.split(new_readme_text, "\n"), "README.md")
if string.find(readme_text, generated_text, 1, "plain") then
if string.find(readme_text, generated_text, 1, true) then
print "README.md is up-to-date!"
vim.cmd "q"
else

View file

@ -1,10 +1,15 @@
-- Execute as `nvim --headless -c "luafile ./scripts/write-lockfile.lua"`
---@type string|any[]
local skip_langs = vim.fn.getenv "SKIP_LOCKFILE_UPDATE_FOR_LANGS"
if skip_langs == vim.NIL then
skip_langs = {}
else
---@diagnostic disable-next-line: param-type-mismatch
skip_langs = vim.fn.split(skip_langs, ",")
end
print("Skipping languages: " .. vim.inspect(skip_langs))
require("nvim-treesitter.install").write_lockfile("verbose", skip_langs)
vim.cmd "q"