Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 864 Bytes

File metadata and controls

36 lines (25 loc) · 864 Bytes

ast-grep-pre-commit-mirror

ast-grep pre-commit hook that uses the PyPI distribution for seamless integration with Python projects.

Usage

Add this to your .pre-commit-config.yaml:

- repo: https://github.com/PFCCLab/ast-grep-pre-commit-mirror
  rev: v0.41.1
  hooks:
    - id: ast-grep

Auto-fix code issues

- id: ast-grep
  args: ["--update-all"]

Custom configuration

- id: ast-grep
  args: ["--config", "ast-grep/sgconfig.yml"]

Writing Rules

ast-grep uses AST pattern matching to search and rewrite code: