[docgen] Update README.md

skip-checks: true
This commit is contained in:
Github Actions 2020-12-10 16:32:20 +00:00 committed by Kiyan
parent 6142223557
commit d8f75f0b09
4 changed files with 25 additions and 8 deletions

View file

@ -27,6 +27,8 @@ jobs:
ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start
- name: Update parsers
env:
SKIP_LOCKFILE_UPDATE_FOR_LANGS: tsx,typescript,javascript # HACK: remove as soon tsx,typescript get updated
run: |
./nvim.appimage --headless -c "luafile ./scripts/write-lockfile.lua" -c "q"
# Pretty print

View file

@ -24,7 +24,7 @@
"revision": "cbec3e4afbf4376bd3a1c0aa9c21009de6013752"
},
"erlang": {
"revision": "53725641da5624a5066c4d01cdb27d7b05cb2810"
"revision": "1648ac4095a410570c9d91aa9d99a202c5a1c5bf"
},
"fennel": {
"revision": "5aad9d1f490b7fc8a847a5b260f23396c56024f5"

View file

@ -323,8 +323,11 @@ function M.uninstall(lang)
end
end
function M.write_lockfile(verbose)
function M.write_lockfile(verbose, skip_langs)
local sorted_parsers = {}
-- Load previous lockfile
get_revision()
skip_langs = skip_langs or {}
for k, v in pairs(parsers.get_parser_configs()) do
table.insert(sorted_parsers, {name = k, parser = v})
@ -333,11 +336,16 @@ function M.write_lockfile(verbose)
table.sort(sorted_parsers, function(a, b) return a.name < b.name end)
for _, v in ipairs(sorted_parsers) do
-- I'm sure this can be done in aync way with iter_cmd
local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1]
lockfile[v.name] = { revision = sha }
if verbose then
print(v.name..': '..sha)
if not vim.tbl_contains(skip_langs, v.name) then
-- I'm sure this can be done in aync way with iter_cmd
local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1]
lockfile[v.name] = { revision = sha }
if verbose then
print(v.name..': '..sha)
end
else
print('Skipping '..v.name)
end
end

View file

@ -1,3 +1,10 @@
-- Execute as `nvim --headless -c "luafile ./scripts/write-lockfile.lua"`
require 'nvim-treesitter.install'.write_lockfile('verbose')
local skip_langs = vim.fn.getenv('SKIP_LOCKFILE_UPDATE_FOR_LANGS')
if skip_langs == vim.NIL then
skip_langs = {}
else
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')