-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ruff as linter/code formatter; apply some suggested fixes
With heavy inspiration from freedomofpress/securedrop#6961
- Loading branch information
Showing
9 changed files
with
129 additions
and
41 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,58 @@ | ||
[project] | ||
name = "securedrop-builder" | ||
version = "0.1.0" | ||
requires-python = ">=3.9" | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
select = [ | ||
# pycodestyle errors | ||
"E", | ||
# pyflakes | ||
"F", | ||
# isort | ||
"I", | ||
# flake8-gettext | ||
"INT", | ||
# flake8-pie | ||
"PIE", | ||
# pylint | ||
"PL", | ||
# flake8-pytest-style | ||
"PT", | ||
# flake8-pyi | ||
"PYI", | ||
# flake8-return | ||
"RET", | ||
# flake8-bandit | ||
"S", | ||
# flake8-simplify | ||
"SIM", | ||
# pyupgrade | ||
"UP", | ||
# pycodestyle warnings | ||
"W", | ||
# Unused noqa directive | ||
"RUF100", | ||
] | ||
ignore = [ | ||
# Find contextlib.suppress() is harder to read | ||
"SIM105", | ||
# Find ternary statements harder to read | ||
"SIM108", | ||
# Flags any subprocess use | ||
"S603", | ||
# Ruff formatter makes a best effort, but may result in some lines exceeding 100 characters | ||
"E501", | ||
] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
# Asserts in tests are fine | ||
"**/tests/*" = [ | ||
# use of `assert` | ||
"S101", | ||
# insecure temporary file/directory | ||
"S108", | ||
# code needs to be reorganized into modules - see https://github.com/freedomofpress/securedrop-builder/issues/465 | ||
"E402" | ||
] |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pytest | ||
pytest-mock | ||
virtualenv<16 | ||
ruff |
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
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
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