From 103842400684073986a3db68a480b3b8e69e75f2 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 22 Dec 2025 13:35:18 -0500 Subject: [PATCH 1/3] update ruff --- python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- python/{{cookiecutter.project_slug}}/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/python/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 31a7668..3e52476 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.12.1 # ruff version + rev: v0.14.10 # 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 1937371..d4eed68 100644 --- a/python/{{cookiecutter.project_slug}}/pyproject.toml +++ b/python/{{cookiecutter.project_slug}}/pyproject.toml @@ -44,7 +44,7 @@ tests = [ ] dev = [ "pre-commit>=4.2.0", - "ruff==0.12.1", + "ruff==0.14.10", {%- if cookiecutter.add_fastapi %} "fastapi[standard]" {%- endif %} From 9f2690ff8cbf14e860660ca18c8148dfa766531f Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 22 Dec 2025 21:34:45 -0500 Subject: [PATCH 2/3] fix config --- .../pyproject.toml | 134 ++++++------------ 1 file changed, 46 insertions(+), 88 deletions(-) diff --git a/python/{{cookiecutter.project_slug}}/pyproject.toml b/python/{{cookiecutter.project_slug}}/pyproject.toml index d4eed68..e4d90f1 100644 --- a/python/{{cookiecutter.project_slug}}/pyproject.toml +++ b/python/{{cookiecutter.project_slug}}/pyproject.toml @@ -99,95 +99,55 @@ exclude = ["docs/source/conf.py"] {%- endif %} [tool.ruff.lint] -select = [ - "F", # https://docs.astral.sh/ruff/rules/#pyflakes-f - "E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w - "I", # https://docs.astral.sh/ruff/rules/#isort-i - "N", # https://docs.astral.sh/ruff/rules/#pep8-naming-n - "D", # https://docs.astral.sh/ruff/rules/#pydocstyle-d - "UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up - "ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann - "ASYNC", # https://docs.astral.sh/ruff/rules/#flake8-async-async - "S", # https://docs.astral.sh/ruff/rules/#flake8-bandit-s - "B", # https://docs.astral.sh/ruff/rules/#flake8-bugbear-b - "A", # https://docs.astral.sh/ruff/rules/#flake8-builtins-a - "C4", # https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4 - "DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz - "T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz - "EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em - "LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log - "G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g - "INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp - "PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie - "T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20 - "PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt - "Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q - "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 -{%- if cookiecutter.add_fastapi %} - "FAST", # https://docs.astral.sh/ruff/rules/#fastapi-fast -{%- endif %} - "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 -] -fixable = [ - "I", - "F401", - "D", - "UP", - "ANN", - "B", - "C4", - "LOG", - "G", - "PIE", - "PT", - "RSE", - "SIM", -{%- if cookiecutter.add_fastapi %} - "FAST", -{%- endif %} - "PLC", - "PLE", - "TRY", - "PERF", - "FURB", - "RUF" -] -# ANN002 - missing-type-args -# ANN003 - missing-type-kwargs -# D203 - one-blank-line-before-class -# D205 - blank-line-after-summary -# D206 - indent-with-spaces* -# D213 - multi-line-summary-second-line -# D300 - triple-single-quotes* -# D400 - ends-in-period -# D415 - ends-in-punctuation -# E111 - indentation-with-invalid-multiple* -# E114 - indentation-with-invalid-multiple-comment* -# E117 - over-indented* -# E501 - line-too-long* -# W191 - tab-indentation* -# S321 - suspicious-ftp-lib-usage -# PLC0206 - dict-index-missing-items -# *ignored for compatibility with formatter +select = ["ALL"] ignore = [ - "ANN002", "ANN003", - "D203", "D205", "D206", "D213", "D300", "D400", "D415", - "E111", "E114", "E117", "E501", + # unused + "AIR", + "ERA", + "YTT", + "BLE", + "FBT", + "CPY", + "DJ", + "EXE", + "FIX", + "FA", + "PYI", + "TD", + "C90", + "NPY", + "PD", + # ignore for compatibility with formatter + "D206", + "D300", + "W191", + "E111", + "E114", + "E117", + "E501", "W191", "S321", + "COM812", + "COM819", + "Q000", + "Q001", + "Q002", + "Q003", + # don't require types on *args, **kwargs + "ANN002", + "ANN003", + # subjective pylint thresholds + "PLR0904", + "PLR091", + "PLR1702", "PLC0206", + # misc unnecessary stuff + "S321", + "D203", + "D205", + "D213", + "D400", + "D415", ] [tool.ruff.lint.per-file-ignores] @@ -202,9 +162,7 @@ ignore = [ "tests/*" = [ "ANN001", "ANN2", - "D100", - "D102", - "D103", + "D", "S101", "B011", "INP001" From 2378682c5994e38f3438ee83226d9ab7da722284 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 22 Dec 2025 21:45:27 -0500 Subject: [PATCH 3/3] update ignore --- python/{{cookiecutter.project_slug}}/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/{{cookiecutter.project_slug}}/pyproject.toml b/python/{{cookiecutter.project_slug}}/pyproject.toml index e4d90f1..c5a994c 100644 --- a/python/{{cookiecutter.project_slug}}/pyproject.toml +++ b/python/{{cookiecutter.project_slug}}/pyproject.toml @@ -159,13 +159,15 @@ ignore = [ # S101 - assert # B011 - assert-false # INP001 - implicit-namespace-package +# PLR2004 - magic-value-comparison "tests/*" = [ "ANN001", "ANN2", "D", "S101", "B011", - "INP001" + "INP001", + "PLR2004", ] [tool.ruff.lint.flake8-annotations]