Skip to content

Commit 592672a

Browse files
authored
Merge pull request #642 from DeepRank/641_ruff_toml_dbodor
ci: move ruff settings to separate toml file
2 parents ea47488 + e2c0e99 commit 592672a

File tree

2 files changed

+59
-60
lines changed

2 files changed

+59
-60
lines changed

.ruff.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
target-version = "py310"
2+
output-format = "concise"
3+
line-length = 159
4+
5+
[lint]
6+
select = ["ALL"]
7+
pydocstyle.convention = "google" # docstring settings
8+
ignore = [
9+
# Unrealistic for this code base
10+
"PTH", # flake8-use-pathlib
11+
"N", # naming conventions
12+
"PLR0912", # Too many branches,
13+
"PLR0913", # Too many arguments in function definition
14+
"D102", # Missing docstring in public method
15+
# Unwanted
16+
"FBT", # Using boolean arguments
17+
"ANN101", # Missing type annotation for `self` in method
18+
"ANN102", # Missing type annotation for `cls` in classmethod
19+
"ANN204", # Missing return type annotation for special (dunder) method
20+
"B028", # No explicit `stacklevel` keyword argument found in warning
21+
"S105", # Possible hardcoded password
22+
"S311", # insecure random generators
23+
"PT011", # pytest-raises-too-broad
24+
"SIM108", # Use ternary operator
25+
# Unwanted docstrings
26+
"D100", # Missing module docstring
27+
"D104", # Missing public package docstring
28+
"D105", # Missing docstring in magic method
29+
"D107", # Missing docstring in `__init__`
30+
]
31+
32+
# Autofix settings
33+
fixable = ["ALL"]
34+
unfixable = ["F401"] # unused imports (should not disappear while editing)
35+
extend-safe-fixes = [
36+
"D415", # First line should end with a period, question mark, or exclamation point
37+
"D300", # Use triple double quotes `"""`
38+
"D200", # One-line docstring should fit on one line
39+
"TCH", # Format type checking only imports
40+
"ISC001", # Implicitly concatenated strings on a single line
41+
"EM", # Exception message variables
42+
"RUF013", # Implicit Optional
43+
"B006", # Mutable default argument
44+
]
45+
46+
isort.known-first-party = ["deeprank2"]
47+
48+
[lint.per-file-ignores]
49+
"tests/*" = [
50+
"S101", # Use of `assert` detected
51+
"PLR2004", # Magic value used in comparison
52+
"D101", # Missing class docstring
53+
"D102", # Missing docstring in public method
54+
"D103", # Missing docstring in public function
55+
"SLF001", # private member access
56+
]
57+
"docs/*" = ["ALL"]
58+
"tests/perf/*" = ["T201"] # Use of print statements
59+
"*.ipynb" = ["T201", "E402", "D103"]

pyproject.toml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -89,63 +89,3 @@ include = ["deeprank2*"]
8989
[tool.pytest.ini_options]
9090
# pytest options: -ra: show summary info for all test outcomes
9191
addopts = "-ra"
92-
93-
[tool.ruff]
94-
output-format = "concise"
95-
line-length = 159
96-
97-
[tool.ruff.lint]
98-
select = ["ALL"]
99-
pydocstyle.convention = "google" # docstring settings
100-
ignore = [
101-
# Unrealistic for this code base
102-
"PTH", # flake8-use-pathlib
103-
"N", # naming conventions
104-
"PLR0912", # Too many branches,
105-
"PLR0913", # Too many arguments in function definition
106-
"D102", # Missing docstring in public method
107-
# Unwanted
108-
"FBT", # Using boolean arguments
109-
"ANN101", # Missing type annotation for `self` in method
110-
"ANN102", # Missing type annotation for `cls` in classmethod
111-
"ANN204", # Missing return type annotation for special (dunder) method
112-
"B028", # No explicit `stacklevel` keyword argument found in warning
113-
"S105", # Possible hardcoded password
114-
"S311", # insecure random generators
115-
"PT011", # pytest-raises-too-broad
116-
"SIM108", # Use ternary operator
117-
# Unwanted docstrings
118-
"D100", # Missing module docstring
119-
"D104", # Missing public package docstring
120-
"D105", # Missing docstring in magic method
121-
"D107", # Missing docstring in `__init__`
122-
]
123-
124-
# Autofix settings
125-
fixable = ["ALL"]
126-
unfixable = ["F401"] # unused imports (should not disappear while editing)
127-
extend-safe-fixes = [
128-
"D415", # First line should end with a period, question mark, or exclamation point
129-
"D300", # Use triple double quotes `"""`
130-
"D200", # One-line docstring should fit on one line
131-
"TCH", # Format type checking only imports
132-
"ISC001", # Implicitly concatenated strings on a single line
133-
"EM", # Exception message variables
134-
"RUF013", # Implicit Optional
135-
"B006", # Mutable default argument
136-
]
137-
138-
isort.known-first-party = ["deeprank2"]
139-
140-
[tool.ruff.lint.per-file-ignores]
141-
"tests/*" = [
142-
"S101", # Use of `assert` detected
143-
"PLR2004", # Magic value used in comparison
144-
"D101", # Missing class docstring
145-
"D102", # Missing docstring in public method
146-
"D103", # Missing docstring in public function
147-
"SLF001", # private member access
148-
]
149-
"docs/*" = ["ALL"]
150-
"tests/perf/*" = ["T201"] # Use of print statements
151-
"*.ipynb" = ["T201", "E402", "D103"]

0 commit comments

Comments
 (0)