{"id":13477171,"url":"https://github.com/astral-sh/ruff-pre-commit","last_synced_at":"2026-02-26T22:08:47.863Z","repository":{"id":62174083,"uuid":"538784618","full_name":"astral-sh/ruff-pre-commit","owner":"astral-sh","description":"A pre-commit hook for Ruff.","archived":false,"fork":false,"pushed_at":"2026-02-26T20:05:38.000Z","size":217,"stargazers_count":1786,"open_issues_count":21,"forks_count":83,"subscribers_count":15,"default_branch":"main","last_synced_at":"2026-02-26T21:59:59.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astral-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-20T02:52:35.000Z","updated_at":"2026-02-26T20:05:41.000Z","dependencies_parsed_at":"2023-12-21T20:12:56.072Z","dependency_job_id":"68a2a34e-bbbf-47fe-83a5-bf536e615e5c","html_url":"https://github.com/astral-sh/ruff-pre-commit","commit_stats":{"total_commits":469,"total_committers":23,"mean_commits":"20.391304347826086","dds":"0.22388059701492535","last_synced_commit":"859e42ab7d54544f32d4f73bbc2136a7d9094f54"},"previous_names":["astral-sh/ruff-pre-commit","charliermarsh/ruff-pre-commit"],"tags_count":395,"template":false,"template_full_name":null,"purl":"pkg:github/astral-sh/ruff-pre-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astral-sh%2Fruff-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astral-sh%2Fruff-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astral-sh%2Fruff-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astral-sh%2Fruff-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astral-sh","download_url":"https://codeload.github.com/astral-sh/ruff-pre-commit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astral-sh%2Fruff-pre-commit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29874556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T16:01:39.016Z","updated_at":"2026-02-26T22:08:47.851Z","avatar_url":"https://github.com/astral-sh.png","language":"Python","readme":"# ruff-pre-commit\n\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![image](https://img.shields.io/pypi/v/ruff/0.15.4.svg)](https://pypi.python.org/pypi/ruff)\n[![image](https://img.shields.io/pypi/l/ruff/0.15.4.svg)](https://pypi.python.org/pypi/ruff)\n[![image](https://img.shields.io/pypi/pyversions/ruff/0.15.4.svg)](https://pypi.python.org/pypi/ruff)\n[![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions)\n\nA [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff).\n\nDistributed as a standalone repository to enable installing Ruff via prebuilt wheels from\n[PyPI](https://pypi.org/project/ruff/).\n\n### Using Ruff with pre-commit\n\nTo run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https://docs.astral.sh/ruff/formatter)\n(available as of Ruff v0.0.289) via pre-commit, add the following to your `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n- repo: https://github.com/astral-sh/ruff-pre-commit\n  # Ruff version.\n  rev: v0.15.4\n  hooks:\n    # Run the linter.\n    - id: ruff-check\n    # Run the formatter.\n    - id: ruff-format\n```\n\nTo enable lint fixes, add the `--fix` argument to the lint hook:\n\n```yaml\nrepos:\n- repo: https://github.com/astral-sh/ruff-pre-commit\n  # Ruff version.\n  rev: v0.15.4\n  hooks:\n    # Run the linter.\n    - id: ruff-check\n      args: [ --fix ]\n    # Run the formatter.\n    - id: ruff-format\n```\n\nTo avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed filetypes:\n\n```yaml\nrepos:\n- repo: https://github.com/astral-sh/ruff-pre-commit\n  # Ruff version.\n  rev: v0.15.4\n  hooks:\n    # Run the linter.\n    - id: ruff-check\n      types_or: [ python, pyi ]\n      args: [ --fix ]\n    # Run the formatter.\n    - id: ruff-format\n      types_or: [ python, pyi ]\n```\n\nWhen running with `--fix`, Ruff's lint hook should be placed _before_ Ruff's formatter hook, and\n_before_ Black, isort, and other formatting tools, as Ruff's fix behavior can output code changes\nthat require reformatting.\n\nWhen running without `--fix`, Ruff's formatter hook can be placed before or after Ruff's lint hook.\n\n(As long as your Ruff configuration avoids any [linter-formatter incompatibilities](https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules),\n`ruff format` should never introduce new lint errors, so it's safe to run Ruff's format hook _after_\n`ruff check --fix`.)\n\n### Using Ruff with prek\n\nIf you prefer using [prek](https://github.com/j178/prek) instead of\npre-commit, you can define a `prek.toml` file with your hooks. Here's an example\nequivalent to the `.pre-commit-config.yaml` configuration:\n\n```toml\n[[repos]]\nrepo = \"https://github.com/astral-sh/ruff-pre-commit\"\nrev = \"v0.15.0\" # Ruff version.\nhooks = [\n  # Run the linter.\n  { id = \"ruff-check\", args = [\"--fix\"], types_or = [\"python\", \"pyi\"] },\n\n  # Run the formatter.\n  { id = \"ruff-format\", types_or = [\"python\", \"pyi\"] },\n]\n```\n\nSee the section above on pre-commit for guidance on hook order when using `--fix`.\n\n## License\n\nruff-pre-commit is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttps://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in ruff-pre-commit by you, as defined in the Apache-2.0 license, shall be\ndually licensed as above, without any additional terms or conditions.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://astral.sh\" style=\"background:none\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/astral-sh/ruff/main/assets/svg/Astral.svg\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastral-sh%2Fruff-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastral-sh%2Fruff-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastral-sh%2Fruff-pre-commit/lists"}