diff --git a/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 5f76687..daefe99 100644 --- a/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: mixed-line-ending args: [ --fix=lf ] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 # ruff version + rev: v0.8.6 # ruff version hooks: - id: ruff-format - id: ruff diff --git a/python/{{cookiecutter.project_slug}}/pyproject.toml b/python/{{cookiecutter.project_slug}}/pyproject.toml index b46baa8..2774b4c 100644 --- a/python/{{cookiecutter.project_slug}}/pyproject.toml +++ b/python/{{cookiecutter.project_slug}}/pyproject.toml @@ -23,7 +23,7 @@ dynamic = ["version"] [project.optional-dependencies] tests = ["pytest", "pytest-cov"] -dev = ["pre-commit>=3.7.1", "ruff==0.5.0"] +dev = ["pre-commit>=3.7.1", "ruff==0.8.6"] {% if cookiecutter.add_docs %} docs = [ "sphinx==6.1.3", @@ -92,10 +92,14 @@ select = [ "RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse "RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret "SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf + "SLOT", # https://docs.astral.sh/ruff/rules/#flake8-slots-slot "SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim "ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg "PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth "PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh + "PLC", # https://docs.astral.sh/ruff/rules/#convention-c + "PLE", # https://docs.astral.sh/ruff/rules/#error-e_1 + "TRY", # https://docs.astral.sh/ruff/rules/#tryceratops-try "PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf "FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb "RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf @@ -114,13 +118,14 @@ fixable = [ "PT", "RSE", "SIM", + "PLC", + "PLE", + "TRY", "PERF", "FURB", "RUF" ] # ANN003 - missing-type-kwargs -# ANN101 - missing-type-self -# ANN102 - missing-type-cls # D203 - one-blank-line-before-class # D205 - blank-line-after-summary # D206 - indent-with-spaces* @@ -134,30 +139,32 @@ fixable = [ # E501 - line-too-long* # W191 - tab-indentation* # S321 - suspicious-ftp-lib-usage +# PLC0206 - dict-index-missing-items # *ignored for compatibility with formatter ignore = [ - "ANN003", "ANN101", "ANN102", + "ANN003", "D203", "D205", "D206", "D213", "D300", "D400", "D415", "E111", "E114", "E117", "E501", "W191", "S321", + "PLC0206", ] [tool.ruff.lint.per-file-ignores] # ANN001 - missing-type-function-argument # ANN2 - missing-return-type -# ANN102 - missing-type-cls # D100 - undocumented-public-module # D102 - undocumented-public-class +# D103 - undocumented-public-function # S101 - assert # B011 - assert-false # INP001 - implicit-namespace-package "tests/*" = [ "ANN001", "ANN2", - "ANN102", "D100", "D102", + "D103", "S101", "B011", "INP001"