You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ADD] ruff integration via matrix position 8 (ruff_matrix_value)
Adds ruff as an opt-in linter/formatter via --compatibility-version.
Position 8 controls the behaviour:
< 20 (default=10): disabled — existing consumers unaffected
>= 20: ruff check+fix runs alongside flake8 and black (transition)
>= 30: ruff replaces flake8/black/isort/autoflake/pyupgrade entirely
New config template ruff.toml.jinja:
line-length=119, target-version=py310, select E/W/F/B/C4/I/UP/N.
Ignores carried forward from .flake8 plus Odoo-specific B006/B008.
isort: odoo+odoo.addons merged into first-party (cosmetic delta from
legacy ODOO/ODOO_ADDONS sections — no lint impact).
skip_string_normalization wired to ruff format quote-style.
Template changes:
.pre-commit-config.yaml.jinja ruff mandatory hook (>= 20), flake8 gated (< 30)
.pre-commit-config-autofix.yaml.jinja ruff check+fix (>= 20), ruff-format (>= 30),
black/autoflake/isort/pyupgrade gated (< 30)
.pre-commit-config-optional.yaml.jinja ruff SIM/RUF/C90 via --extend-select (>= 20),
flake8-bugbear gated (< 30)
Deviations discovered during CI validation:
1. ruff-format gated at >= 30, not >= 20. Running ruff-format and black
simultaneously causes an infinite format loop: the two formatters
disagree on wrapping point for multiline assert expressions. At
value=20, ruff provides lint fixes only; black remains the formatter.
2. B036 and E123 dropped from ignore list. Neither rule exists in ruff
(rejected as "Unknown rule selector"). No practical impact.
3. B018 added to __manifest__.py per-file-ignores. ruff B018 fires on
Odoo manifest bare dict literals, which are intentional.
4. Optional hook uses --extend-select, not --select. CLI --select
overrides the config ignore list, re-triggering UP031.
5. ci/bootstrap.py, docs/conf.py, pre_commit_vauxoo.py: .format() calls
converted to f-strings (UP032). The docker test runs ruff on the
repo's own source; these files had to comply.
6. tests/test_pre_commit_vauxoo.py: two assert statements reformatted to
a layout both black and ruff-format accept without conflict.
Benchmark (25 files, ruff 0.15.16 / black 26.5.1 / isort, Ubuntu 24.04):
ruff check + ruff format ~130 ms
black + isort (partial legacy) ~570 ms (~4x faster)
full legacy stack estimate
(+ flake8 + autoflake + pyupgrade) ~1270 ms (~10x faster)
0 commit comments