From a481f2dd4da57e9298d3b8c57ff32f2c58275826 Mon Sep 17 00:00:00 2001 From: Alessio <148966056+alessio-locatelli@users.noreply.github.com> Date: Sat, 8 Aug 2026 09:13:19 +0300 Subject: [PATCH] chore: add ruff-extra-rules linter/formatter --- .gitignore | 1 + .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index 6437f86e..d9217fba 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ venv/ .mypy_cache/ .tox test-reports/ +.cache # Sphinx docs/_build/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f22ac2df..5ab637ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,3 +27,9 @@ repos: rev: v1.47.2 hooks: - id: typos + - repo: https://github.com/alessio-locatelli/ruff-extra-rules + rev: v0.2.2 + hooks: + - id: ruff-extra-rules + - id: ruff-extra-rules-ty + additional_dependencies: [ty] diff --git a/pyproject.toml b/pyproject.toml index d74f6749..5f05e9f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,5 +147,15 @@ known-first-party = ['test'] [tool.ruff.lint.pycodestyle] max-line-length = 120 +[tool.ruff-extra-rules] +fix = true + +[tool.ruff-extra-rules.per-file-ignores] +# Keeping the library interface (regardless of whether it is a public or +# private function) is more important than renaming a function for a negligible +# clarity improvement. However, this can be done in the next major release. +"aiohttp_client_cache/*" = ["validate-function-name"] +"examples/*" = ["validate-function-name"] + [tool.typos] files.extend-exclude = ["CONTRIBUTORS.md"]