Enable FBT in flake8 and ruff

This commit is contained in:
Alexander Hess 2026-11-30 22:43:35 +01:00
commit 5beb88559f
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -94,6 +94,7 @@ dev = [
"flake8-annotations (>=3.3.1,<4.0.0)",
"flake8-bandit (>=4.1.1,<5.0.0)",
"flake8-black (>=0.5.0,<0.6.0)",
"flake8-boolean-trap (>=1.0.1,<2.0.0)",
"flake8-broken-line (>=1.0.0,<2.0.0)",
"flake8-bugbear (>=26.11.22,<27.0.0)",
"flake8-builtins (>=3.2.0,<4.0.0)",
@ -210,6 +211,8 @@ select = [
"S1", "S2", "S3", "S4", "S5", "S6", "S7",
# flake8-black => complain if black would make changes
"BLK1", "BLK9",
# flake8-boolean-trap => Keyword-only flags
"FBT",
# flake8-broken-line => no \ to end a line
"N400",
# flake8-bugbear => opinionated bugs and design flaws
@ -279,6 +282,8 @@ extend-ignore = [
# Comply with black's style.
# Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
"E203", "W503",
# `ruff`'s FBT003 does this better, as it allows builtins like `setattr()`.
"FBT003",
# Every `.add()` looks like `pandas` to this rule (`ruff` omits it).
"PD005",
# Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`.
@ -506,6 +511,8 @@ select = [
"E", "W",
# pyflakes => basic errors
"F",
# flake8-boolean-trap => Keyword-only flags
"FBT",
# flake8-implicit-str-concat => Unified string concatenation
"ISC",
# pep8-naming => PEP8 naming conventions