https://github.com/boidolr/ast-grep-pre-commit

Structural lint and rewriting with ast-grep for pre-commit hooks

https://github.com/boidolr/ast-grep-pre-commit

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

ast-grep codemod git-hooks pre-commit refactoring

Keywords from Contributors

controllers gan report autograder hack animal standardization interpretability metering pytest
Last synced: 5 months ago · JSON representation

Repository

Structural lint and rewriting with ast-grep for pre-commit hooks

Basic Info
  • Host: GitHub
  • Owner: boidolr
  • License: mit
  • Default Branch: main
  • Homepage:
  • Size: 67.4 KB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
ast-grep codemod git-hooks pre-commit refactoring
Created about 2 years ago · Last pushed 6 months ago
Metadata Files
Readme License Codeowners

README.md

ast-grep-pre-commit tag Build

pre-commit

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

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

All Time
  • Total Commits: 119
  • Total Committers: 3
  • Avg Commits per committer: 39.667
  • Development Distribution Score (DDS): 0.353
Past Year
  • Commits: 68
  • Committers: 2
  • Avg Commits per committer: 34.0
  • Development Distribution Score (DDS): 0.324
Top Committers
Name Email 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
dependencies (1) github-tags (1) github-actions (1)
Pull Request Labels
dependencies (57) github-tags (57) github-actions (57)

Dependencies

package.json npm
.github/workflows/test.yaml actions
  • actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
  • boidolr/actions/run-precommit main composite
.github/workflows/update.yaml actions
  • actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
  • actions/download-artifact eaceaf801fd36c7dee90939fad912460b18a1ffe composite
  • actions/upload-artifact 5d5d22a31266ced268874388b861e4b58bb5c2f3 composite