Skip to content

Commit 87e418c

Browse files
author
Lukas Pühringer
authored
Merge pull request #2627 from jku/finish-ruff-integration
linting: Enable all Ruff rulesets by default
2 parents d855d1c + 419bfe3 commit 87e418c

File tree

2 files changed

+28
-37
lines changed

2 files changed

+28
-37
lines changed

pyproject.toml

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -81,55 +81,48 @@ dev-mode-dirs = ["."]
8181
line-length=80
8282

8383
[tool.ruff.lint]
84-
select = [
85-
"A", # flake8-builtins
86-
"ANN", # flake8-annotations
87-
"ARG", # flake8-unused-arguments
88-
"B", # flake8-bugbear
89-
"BLE", # flake8-blind-except
90-
"C4", # flake8-comprehensions
91-
"D", # pydocstyle
92-
"DTZ", # flake8-datetimez
93-
"E", # pycodestyle
94-
"EXE", # flake8-executable
95-
"F", # pyflakes
96-
"I", # isort
97-
"ISC", # flake8-implicit-str-concat
98-
"N", # pep8-naming
99-
"PL", # pylint
100-
"PGH", # pygrep-hooks
101-
"PIE", # flake8-pie
102-
"PYI", # flake8-pyi
103-
"RET", # flake8-return
104-
"RSE", # flake8-raise
105-
"RUF", # ruff-specific rules
106-
"S", # flake8-bandit
107-
"SIM", # flake8-simplify
108-
"SLF", # flake8-self
109-
"UP", # pyupgrade
110-
"W", # pycodestyle-warning
111-
]
84+
select = ["ALL"]
11285
ignore = [
86+
# Rulesets we do not use at this moment
87+
"COM",
88+
"EM",
89+
"FA",
90+
"FIX",
91+
"FBT",
92+
"PERF",
93+
"PT",
94+
"PTH",
95+
"TD",
96+
"TRY",
97+
98+
# Individual rules that have been disabled
11399
"ANN101", "ANN102", # nonsense, deprecated in ruff
114100
"D400", "D415", "D213", "D205", "D202", "D107", "D407", "D413", "D212", "D104", "D406", "D105", "D411", "D401", "D200", "D203",
115-
"PLR0913", "PLR2004",
116101
"ISC001", # incompatible with ruff formatter
102+
"PLR0913", "PLR2004",
117103
]
118104

119105
[tool.ruff.lint.per-file-ignores]
120106
"tests/*" = [
121107
"D", # pydocstyle: no docstrings required for tests
122108
"E501", # line-too-long: embedded test data in "fmt: off" blocks is ok
109+
"ERA001", # commented code is fine in tests
123110
"RUF012", # ruff: mutable-class-default
124111
"S", # bandit: Not running bandit on tests
125-
"SLF001" # private member access is ok in tests
112+
"SLF001", # private member access is ok in tests
113+
"T201", # print is ok in tests
126114
]
127115
"examples/*/*" = [
128-
"D", # pydocstyle: no docstrings required for examples
129-
"S" # bandit: Not running bandit on examples
116+
"D", # pydocstyle: no docstrings required for examples
117+
"ERA001", # commented code is fine in examples
118+
"INP001", # implicit package is fine in examples
119+
"S", # bandit: Not running bandit on examples
120+
"T201", # print is ok in examples
130121
]
131122
"verify_release" = [
132-
"S603", # bandit: this flags all uses of subprocess.run as vulnerable
123+
"ERA001", # commented code is fine here
124+
"S603", # bandit: this flags all uses of subprocess.run as vulnerable
125+
"T201", # print is ok in verify_release
133126
]
134127

135128
[tool.ruff.lint.flake8-annotations]

tests/utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def _start_server(
218218

219219
self._wait_for_port(timeout)
220220

221-
self.__logger.info(self.server + " serving on " + str(self.port))
221+
self.__logger.info("%s serving on %d", self.server, self.port)
222222

223223
def _start_process(self, extra_cmd_args: List[str], popen_cwd: str) -> None:
224224
"""Starts the process running the server."""
@@ -319,9 +319,7 @@ def _kill_server_process(self) -> None:
319319
assert isinstance(self.__server_process, subprocess.Popen)
320320
if self.is_process_running():
321321
self.__logger.info(
322-
"Server process "
323-
+ str(self.__server_process.pid)
324-
+ " terminated."
322+
"Server process %d terminated", self.__server_process.pid
325323
)
326324
self.__server_process.kill()
327325
self.__server_process.wait()

0 commit comments

Comments
 (0)