Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move ruff settings to separate toml file #642

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
target-version = "py310"
output-format = "concise"
line-length = 159

[lint]
select = ["ALL"]
pydocstyle.convention = "google" # docstring settings
ignore = [
# Unrealistic for this code base
"PTH", # flake8-use-pathlib
"N", # naming conventions
"PLR0912", # Too many branches,
"PLR0913", # Too many arguments in function definition
"D102", # Missing docstring in public method
# Unwanted
"FBT", # Using boolean arguments
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN204", # Missing return type annotation for special (dunder) method
"B028", # No explicit `stacklevel` keyword argument found in warning
"S105", # Possible hardcoded password
"S311", # insecure random generators
"PT011", # pytest-raises-too-broad
"SIM108", # Use ternary operator
# Unwanted docstrings
"D100", # Missing module docstring
"D104", # Missing public package docstring
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
]

# Autofix settings
fixable = ["ALL"]
unfixable = ["F401"] # unused imports (should not disappear while editing)
extend-safe-fixes = [
"D415", # First line should end with a period, question mark, or exclamation point
"D300", # Use triple double quotes `"""`
"D200", # One-line docstring should fit on one line
"TCH", # Format type checking only imports
"ISC001", # Implicitly concatenated strings on a single line
"EM", # Exception message variables
"RUF013", # Implicit Optional
"B006", # Mutable default argument
]

isort.known-first-party = ["deeprank2"]

[lint.per-file-ignores]
"tests/*" = [
"S101", # Use of `assert` detected
"PLR2004", # Magic value used in comparison
"D101", # Missing class docstring
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"SLF001", # private member access
]
"docs/*" = ["ALL"]
"tests/perf/*" = ["T201"] # Use of print statements
"*.ipynb" = ["T201", "E402", "D103"]
60 changes: 0 additions & 60 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,63 +89,3 @@ include = ["deeprank2*"]
[tool.pytest.ini_options]
# pytest options: -ra: show summary info for all test outcomes
addopts = "-ra"

[tool.ruff]
output-format = "concise"
line-length = 159

[tool.ruff.lint]
select = ["ALL"]
pydocstyle.convention = "google" # docstring settings
ignore = [
# Unrealistic for this code base
"PTH", # flake8-use-pathlib
"N", # naming conventions
"PLR0912", # Too many branches,
"PLR0913", # Too many arguments in function definition
"D102", # Missing docstring in public method
# Unwanted
"FBT", # Using boolean arguments
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN204", # Missing return type annotation for special (dunder) method
"B028", # No explicit `stacklevel` keyword argument found in warning
"S105", # Possible hardcoded password
"S311", # insecure random generators
"PT011", # pytest-raises-too-broad
"SIM108", # Use ternary operator
# Unwanted docstrings
"D100", # Missing module docstring
"D104", # Missing public package docstring
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
]

# Autofix settings
fixable = ["ALL"]
unfixable = ["F401"] # unused imports (should not disappear while editing)
extend-safe-fixes = [
"D415", # First line should end with a period, question mark, or exclamation point
"D300", # Use triple double quotes `"""`
"D200", # One-line docstring should fit on one line
"TCH", # Format type checking only imports
"ISC001", # Implicitly concatenated strings on a single line
"EM", # Exception message variables
"RUF013", # Implicit Optional
"B006", # Mutable default argument
]

isort.known-first-party = ["deeprank2"]

[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Use of `assert` detected
"PLR2004", # Magic value used in comparison
"D101", # Missing class docstring
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"SLF001", # private member access
]
"docs/*" = ["ALL"]
"tests/perf/*" = ["T201"] # Use of print statements
"*.ipynb" = ["T201", "E402", "D103"]
Loading