-
Notifications
You must be signed in to change notification settings - Fork 49
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
Flag-day: Auto-format and lint with black, isort, pylint and bandit + add to CI #439
Flag-day: Auto-format and lint with black, isort, pylint and bandit + add to CI #439
Commits on Oct 20, 2022
-
Update format-related config and requirements
- Add black, isort, pylint and bandit to test requirements - Update indent in editorconfig to match black (4 spaces) - Add basic pylintrc file (copy-pasted from python-tuf) - gitignore pre-commit config Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 52a0b6b - Browse repository at this point
Copy the full SHA 52a0b6bView commit details -
Used command: `black --line-length=80 --extend-exclude=_vendor .` Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 8531f7d - Browse repository at this point
Copy the full SHA 8531f7dView commit details -
Used command: ``` isort --line-length=80 --extend-skip-glob='*/_vendor' \ --profile=black --project=securesystemslib . ``` Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for b48bc23 - Browse repository at this point
Copy the full SHA b48bc23View commit details -
Ignore pylint non-error/fatal pylint issues inline
Inline-disable all non-error/fatal pylint issues raised by running `pylint -j 0 --rcfile=pylintrc securesystemslib tests`, by adding inline comments a la `"# pylint: disable=<issue>[, ...]"`. This allows running pylint on future PRs without spending much effort on existing code, whose future is uncertain (see secure-systems-lab#270). The patch was created mostly automatically with this script: https://gist.github.com/lukpueh/41026a3a7a594164150faf5afce94774 Unfortunately, both black and isort reformat inline comments in a way that pylint won't consider them anymore. Thus, some manual adjustments after running above script were necessary. https://black.readthedocs.io/en/stable/faq.html#why-does-my-linter-or-typechecker-complain-after-i-format-my-code Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 91ac1f3 - Browse repository at this point
Copy the full SHA 91ac1f3View commit details -
Fix pylint error E0102 (function-redefined)
Remove outdated original function. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 32b654b - Browse repository at this point
Copy the full SHA 32b654bView commit details -
Disable pylint error E1101 (no-member)
This seems to be a false positive related to unpacking a tuple in a for loop. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 8bf06db - Browse repository at this point
Copy the full SHA 8bf06dbView commit details -
Ignore low/medium-severity bandit issues inline
Inline-disable low/medium-severity bandit issues raised by running `bandit --recursive securesystemslib --exclude _vendor`, by adding inline comments a la `"# nosec"`. This allows running bandit on future PRs without spending much effort on existing code, whose future is uncertain (see secure-systems-lab#270). Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 5c2b1d2 - Browse repository at this point
Copy the full SHA 5c2b1d2View commit details -
Configure black, isort, pylint and bandit in CI
- Add 'lint' tox environment that runs black, isort and bandit, and mypy (moved from its own env). - Run new tox env in ci GitHub Action. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for 6ede7d6 - Browse repository at this point
Copy the full SHA 6ede7d6View commit details -
List flag-day commits in .git-blame-ignore-revs
For usage and details see: https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Configuration menu - View commit details
-
Copy full SHA for b831bd2 - Browse repository at this point
Copy the full SHA b831bd2View commit details