-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a ruff.toml config file for linting python and add ruff to the li…
…nting workflow file.
- Loading branch information
1 parent
aa8eba2
commit f435781
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[format] | ||
docstring-code-format = true | ||
|
||
[lint] | ||
# See https://docs.astral.sh/ruff/rules for full details of each ruleset. | ||
|
||
# Enable: D: `pydocstyle`, PL: `pylint`, I: `isort`, W: `pycodestyle whitespace` | ||
# NPY: `numpy`, FLY: `flynt`, RUF: `ruff` | ||
# From flake8: "ARG", "SLF", "S", "BLE", "B", "A", "C4", "EM", "ICN", | ||
# "PIE", "Q", "RSE", "SIM", "TID" | ||
select = ["D", "PL", "I", "E", "W", "NPY", "FLY", "RUF", | ||
"ARG", "SLF", "S", "BLE","B", "A", "C4", "EM", "ICN", "PIE", "Q", "RSE", | ||
"SIM", "TID"] | ||
|
||
# Enable D417 (Missing argument description) on top of the NumPy convention. | ||
extend-select = ["D417"] | ||
|
||
# Ignore SIM108 (use ternary instead of if-else) as it can arguably obscure intent. | ||
# Ignore RUF002 (ambiguous characters) as it does not allow apostrophes in strings. | ||
ignore = ["SIM108", "RUF002"] | ||
|
||
[lint.pydocstyle] | ||
# Use NumPy convention for checking docstrings | ||
convention = "numpy" |