mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-04 12:30:01 -04:00
Problem: Many parsers require node/npm to evaluate the `grammar.js` before being able to generate a parser from it. Solution: Generate from `grammar.json` instead, which is fully resolved. Drops `node` and `npm` as (optional) requirements for nvim-treesitter. Note that this requires parsers to commit the generated json iff the grammar requires evaluation (which is currently the case for all tracked languages).
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
name: Linting and style checking
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
|
|
jobs:
|
|
luacheck:
|
|
name: Luacheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Prepare
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install luarocks -y
|
|
sudo luarocks install luacheck
|
|
|
|
- name: Run Luacheck
|
|
run: luacheck .
|
|
|
|
stylua:
|
|
name: StyLua
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Lint with stylua
|
|
uses: JohnnyMorganz/stylua-action@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: latest
|
|
args: --check .
|
|
|
|
format-queries:
|
|
name: Lint queries
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NVIM_TAG: nightly
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: tree-sitter/setup-action/cli@v1
|
|
- name: Prepare
|
|
run: |
|
|
bash ./scripts/ci-install.sh
|
|
|
|
- name: Lint
|
|
run: |
|
|
nvim -l scripts/install-parsers.lua query
|
|
nvim -l scripts/format-queries.lua
|
|
git diff --exit-code
|