-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from freedomofpress/add-ruff
Add ruff for lint & formatting checks; apply some suggested fixes
- Loading branch information
Showing
11 changed files
with
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,18 @@ | ||
--- | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
checks: | ||
runs-on: ubuntu-latest | ||
container: debian:bullseye | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
apt-get update && apt-get install --yes --no-install-recommends make python3-pip | ||
pip install -r test-requirements.txt | ||
- name: Run lint checks | ||
run: | | ||
make lint |
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,56 @@ | ||
[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", | ||
] | ||
|
||
[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