{"id":14263246,"url":"https://github.com/boidolr/ast-grep-pre-commit","last_synced_at":"2025-06-15T13:08:50.991Z","repository":{"id":220378542,"uuid":"751481461","full_name":"boidolr/ast-grep-pre-commit","owner":"boidolr","description":"Structural lint and rewriting with ast-grep for pre-commit hooks","archived":false,"fork":false,"pushed_at":"2025-06-02T06:52:26.000Z","size":58,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T17:24:40.083Z","etag":null,"topics":["ast-grep","codemod","git-hooks","pre-commit","refactoring"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boidolr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-01T17:39:03.000Z","updated_at":"2025-06-02T06:52:29.000Z","dependencies_parsed_at":"2024-05-12T10:31:13.236Z","dependency_job_id":"f43ce2b2-9d1f-4977-b08f-73b73802f190","html_url":"https://github.com/boidolr/ast-grep-pre-commit","commit_stats":null,"previous_names":["boidolr/precommit-ast-grep","boidolr/ast-grep-pre-commit"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/boidolr/ast-grep-pre-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boidolr%2Fast-grep-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boidolr%2Fast-grep-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boidolr%2Fast-grep-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boidolr%2Fast-grep-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boidolr","download_url":"https://codeload.github.com/boidolr/ast-grep-pre-commit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boidolr%2Fast-grep-pre-commit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259981477,"owners_count":22941149,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast-grep","codemod","git-hooks","pre-commit","refactoring"],"created_at":"2024-08-22T13:04:46.773Z","updated_at":"2025-06-15T13:08:45.979Z","avatar_url":"https://github.com/boidolr.png","language":null,"funding_links":[],"categories":["others"],"sub_categories":[],"readme":"ast-grep-pre-commit\n[![tag](https://img.shields.io/github/v/tag/boidolr/ast-grep-pre-commit?sort=semver)](https://github.com/boidolr/ast-grep-pre-commit/tags)\n[![Build](https://github.com/boidolr/ast-grep-pre-commit/actions/workflows/test.yaml/badge.svg)](https://github.com/boidolr/ast-grep-pre-commit/actions/workflows/test.yaml)\n[![pre-commit](https://img.shields.io/badge/pre--commit-hook-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n================\n\n\nMinimal git hook to run [ast-grep](https://github.com/ast-grep/ast-grep) based on the [pre-commit](https://github.com/pre-commit/pre-commit) framework.\n\n## Using ast-grep-pre-commit with pre-commit\n\nAdd this to your `.pre-commit-config.yaml`:\n```\n  - repo: https://github.com/boidolr/ast-grep-pre-commit\n    rev: 0.31.1  # Use the ref you want to point at\n    hooks:\n      - id: ast-grep\n```\n\nNote that only rules with a severity of \"error\" will lead to the commit hook failing.\n\n\n### Automatically execute rewrites\n\n```\n  - repo: https://github.com/boidolr/ast-grep-pre-commit\n    rev: 0.31.1\n    hooks:\n      - id: ast-grep\n        args: [\"--update-all\"]\n```\n\n\n### Provide explicit configuration\n\n```\n  - repo: https://github.com/boidolr/ast-grep-pre-commit\n    rev: 0.31.1\n    hooks:\n      - id: ast-grep\n        args: [\"--config\", \"/some/path/sgconfig.yaml\"]\n```\n\n\n## How to write rules\n\nSee https://ast-grep.github.io/ for details on `ast-grep` and how to write linters and rewriters.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboidolr%2Fast-grep-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboidolr%2Fast-grep-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboidolr%2Fast-grep-pre-commit/lists"}