srf-tree-sitter/.pre-commit-config.yaml
2026-09-01 10:07:02 -07:00

29 lines
955 B
YAML

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# tree-sitter generate emits these two without a trailing newline, so
# the fixer and the generate hook below would undo each other forever.
exclude: ^src/(grammar|node-types)\.json$
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: tree-sitter-generate
name: Generate tree-sitter parser
entry: tree-sitter
args: ["generate"]
language: system
files: grammar\.js$
pass_filenames: false
- id: tree-sitter-test
name: Run tree-sitter tests
entry: tree-sitter
args: ["test"]
language: system
types: [file]
pass_filenames: false