Skip to content

Commit 56cc7ff

Browse files
committed
Add RUF018 to lint.select
1 parent 1357917 commit 56cc7ff

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

template/pyproject.toml.jinja

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,19 @@ allowlist_externals =
103103
src = ["src", "tests"]
104104
line-length = 88
105105
lint.select = [
106-
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
107-
"C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
108-
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
109-
"F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
110-
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
111-
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
112-
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
113-
"SLF", # self - https://docs.astral.sh/ruff/settings/#lintflake8-self
106+
"B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
107+
"C4", # flake8-comprehensions - https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
108+
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e
109+
"F", # pyflakes rules - https://docs.astral.sh/ruff/rules/#pyflakes-f
110+
"W", # pycodestyle warnings - https://docs.astral.sh/ruff/rules/#warning-w
111+
"I", # isort - https://docs.astral.sh/ruff/rules/#isort-i
112+
"UP", # pyupgrade - https://docs.astral.sh/ruff/rules/#pyupgrade-up
113+
"SLF", # self - https://docs.astral.sh/ruff/settings/#lintflake8-self
114+
"RUF018" # walrus operators in asserts - https://docs.astral.sh/ruff/rules/assignment-in-assert/
114115
]
115116

116117
[tool.ruff.lint.per-file-ignores]
117118
# By default, private member access is allowed in tests
118119
# See https://github.com/DiamondLightSource/python-copier-template/issues/154
119-
# Remove this line to forbid private member access in tests
120-
"tests/**/*" = ["SLF001"]
120+
# Remove this line to forbid private member access, walrus operators inside asserts in tests
121+
"tests/**/*" = ["SLF001", "RUF018"]

0 commit comments

Comments
 (0)