Minimal git hook to run ast-grep based on the pre-commit framework.
Add this to your .pre-commit-config.yaml
:
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.30.1 # Use the ref you want to point at
hooks:
- id: ast-grep
Note that only rules with a severity of "error" will lead to the commit hook failing.
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.30.1
hooks:
- id: ast-grep
args: ["--update-all"]
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.30.1
hooks:
- id: ast-grep
args: ["--config", "/some/path/sgconfig.yaml"]
See https://ast-grep.github.io/ for details on ast-grep
and how to write linters and rewriters.