https://github.com/boidolr/ast-grep-pre-commit
Structural lint and rewriting with ast-grep for pre-commit hooks
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.7%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Structural lint and rewriting with ast-grep for pre-commit hooks
Statistics
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Minimal git hook to run ast-grep based on the pre-commit framework.
Using ast-grep-pre-commit with pre-commit
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.39.5 # Use the ref you want to point at
hooks:
- id: ast-grep
Note that, by default, only rules with a severity of "error" will lead to the commit hook failing.
If you wish to handle rules differently, set their error level in the rule configuration or via --error.
Automatically execute rewrites
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.39.5
hooks:
- id: ast-grep
args: ["--update-all"]
Provide explicit configuration
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.39.5
hooks:
- id: ast-grep
args: ["--config", "/some/path/sgconfig.yaml"]
Overwrite ast-grep version
The hook version mirrors the version of ast-grep.
If for any reason you want up- or downgrade the ast-grep version used by the hook, for example to get an update before the hook was published, you can do so:
- repo: https://github.com/boidolr/ast-grep-pre-commit
rev: 0.39.5
hooks:
- id: ast-grep
additional_dependencies: ["@ast-grep/cli@0.38.1"] # set the desired version
How to write rules
See https://ast-grep.github.io/ for details on ast-grep and how to write linters and rewriters.
Owner
- Name: Raphael Boidol
- Login: boidolr
- Kind: user
- Location: Munich, Germany
- Company: @TNG
- Website: https://boidolr.github.io/
- Repositories: 12
- Profile: https://github.com/boidolr
coding for the fun of it
GitHub Events
Total
- Watch event: 2
- Delete event: 17
- Push event: 51
- Pull request event: 35
- Create event: 45
Last Year
- Watch event: 2
- Delete event: 17
- Push event: 51
- Pull request event: 35
- Create event: 45
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| boidolr | b****r | 77 |
| renovate[bot] | 2****] | 31 |
| github-actions | 4****] | 11 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 1
- Total pull requests: 45
- Average time to close issues: about 7 hours
- Average time to close pull requests: about 4 hours
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 43
- Bot issues: 1
- Bot pull requests: 42
Past Year
- Issues: 1
- Pull requests: 33
- Average time to close issues: about 7 hours
- Average time to close pull requests: about 5 hours
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 32
- Bot issues: 1
- Bot pull requests: 32
Top Authors
Issue Authors
- boidolr (1)
- renovate[bot] (1)
Pull Request Authors
- renovate[bot] (57)
- boidolr (3)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
- boidolr/actions/run-precommit main composite
- actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
- actions/download-artifact eaceaf801fd36c7dee90939fad912460b18a1ffe composite
- actions/upload-artifact 5d5d22a31266ced268874388b861e4b58bb5c2f3 composite