feat(tests)!: new infrastructure based on makefile
Problem: Not easy to run all checks and tests locally. Redundant CI
workflows.
Solution: Separate CI into two workflows:
* lint: Lua files (stylua, luals), query files (valid captures,
predicates, directives using tsqueryls), docs
(SUPPORTED_LANGUAGES.md) -- does not need parser installation
* tests: parsers (ABI compatibility), query files (tsqueryls on
Linux/macOS; nvim on Windows), highlight and indent tests (separated
for better readability) -- needs parser installation (but only once)
Switch to https://github.com/nvim-treesitter/highlight-assertions fork
with ABI 15 support.
Run all tests (on Linux and macOS) through `make` (`formatlua`,
`checklua`, `lintquery`, `formatquery`, `checkquery`, `docs`, `tests`),
which downloads and caches all necessary dependencies.
Remove `update-readme` workflow (replaced by lint job on PRs).
2025-04-29 19:40:18 +02:00
|
|
|
vim.opt.runtimepath:append(os.getenv('PLENARY'))
|
2023-06-12 09:54:30 -06:00
|
|
|
vim.opt.runtimepath:append('.')
|
|
|
|
|
vim.cmd.runtime({ 'plugin/plenary.vim', bang = true })
|
|
|
|
|
vim.cmd.runtime({ 'plugin/query_predicates.lua', bang = true })
|
2023-05-29 16:52:20 +02:00
|
|
|
vim.cmd.runtime({ 'plugin/filetypes.lua', bang = true })
|
2021-03-13 22:46:45 +01:00
|
|
|
|
2023-06-12 09:54:30 -06:00
|
|
|
vim.filetype.add({
|
2023-05-15 16:21:48 +09:00
|
|
|
extension = {
|
2023-06-12 09:54:30 -06:00
|
|
|
conf = 'hocon',
|
|
|
|
|
ncl = 'nickel',
|
|
|
|
|
tig = 'tiger',
|
|
|
|
|
w = 'wing',
|
2023-05-15 16:21:48 +09:00
|
|
|
},
|
2023-06-12 09:54:30 -06:00
|
|
|
})
|
2022-01-16 15:26:01 +02:00
|
|
|
|
2021-04-17 22:40:54 +02:00
|
|
|
vim.o.swapfile = false
|
|
|
|
|
vim.bo.swapfile = false
|
2021-03-13 22:46:45 +01:00
|
|
|
|
2023-06-12 09:54:30 -06:00
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
|
|
|
callback = function(args)
|
|
|
|
|
pcall(vim.treesitter.start)
|
2023-05-29 16:52:20 +02:00
|
|
|
vim.bo[args.buf].indentexpr = 'v:lua.require"nvim-treesitter".indentexpr()'
|
2023-06-12 09:54:30 -06:00
|
|
|
end,
|
|
|
|
|
})
|