nvim-treesitter/.github/workflows/lint.yml
Christian Clason 5a38df5627 feat(install)!: generate from json instead of requiring node
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).
2025-05-12 18:43:40 +02:00

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