mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 11:50:09 -04:00
Allow failures for defined parsers
This commit is contained in:
parent
04982cde88
commit
8704b0f388
2 changed files with 9 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ jobs:
|
||||||
|
|
||||||
- name: Check query files (Unix)
|
- name: Check query files (Unix)
|
||||||
if: matrix.os != 'windows-latest'
|
if: matrix.os != 'windows-latest'
|
||||||
|
env:
|
||||||
|
ALLOWED_INSTALLATION_FAILURES: haskell
|
||||||
run: nvim --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
run: nvim --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
||||||
|
|
||||||
- name: Compile parsers Windows
|
- name: Compile parsers Windows
|
||||||
|
|
@ -53,6 +55,8 @@ jobs:
|
||||||
|
|
||||||
- name: Check query files (Windows)
|
- name: Check query files (Windows)
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
|
env:
|
||||||
|
ALLOWED_INSTALLATION_FAILURES: haskell
|
||||||
run: C:\\tools\\neovim\\Neovim\\bin\\nvim.exe --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
run: C:\\tools\\neovim\\Neovim\\bin\\nvim.exe --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,15 @@ end
|
||||||
|
|
||||||
|
|
||||||
local ok, err = pcall(do_check)
|
local ok, err = pcall(do_check)
|
||||||
|
local allowed_to_fail = vim.split(vim.env.ALLOWED_INSTALLATION_FAILURES or '', ",", true)
|
||||||
|
|
||||||
for k, v in pairs(require 'nvim-treesitter.parsers'.get_parser_configs()) do
|
for k, v in pairs(require 'nvim-treesitter.parsers'.get_parser_configs()) do
|
||||||
if not require 'nvim-treesitter.parsers'.has_parser(k) then
|
if not require 'nvim-treesitter.parsers'.has_parser(k) then
|
||||||
-- On CI all parsers that can be installed from C files should be installed
|
-- On CI all parsers that can be installed from C files should be installed
|
||||||
if vim.env.CI and not v.install_info.requires_generate_from_grammar then
|
if vim.env.CI
|
||||||
|
and not v.install_info.requires_generate_from_grammar
|
||||||
|
and not vim.tbl_contains(allowed_to_fail, k) then
|
||||||
|
|
||||||
print('Error: parser for '..k..' is not installed')
|
print('Error: parser for '..k..' is not installed')
|
||||||
vim.cmd('cq')
|
vim.cmd('cq')
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue