[flake8-bandit] Implement S4XX suspicious import rules#8831
Merged
charliermarsh merged 8 commits intoastral-sh:mainfrom Jan 3, 2024
Merged
[flake8-bandit] Implement S4XX suspicious import rules#8831charliermarsh merged 8 commits intoastral-sh:mainfrom
flake8-bandit] Implement S4XX suspicious import rules#8831charliermarsh merged 8 commits intoastral-sh:mainfrom
Conversation
5e2bc90 to
b5de9d9
Compare
b5de9d9 to
5292b86
Compare
Contributor
Author
|
@charliermarsh I added basic docs for all the rules. Ready for review or for culling anything which is redundant or unwanted in the end. Either way afterwards all |
Contributor
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| S404 | 204 | 204 | 0 | 0 | 0 |
| S403 | 33 | 33 | 0 | 0 | 0 |
| S405 | 9 | 9 | 0 | 0 | 0 |
| S402 | 4 | 4 | 0 | 0 | 0 |
| S410 | 3 | 3 | 0 | 0 | 0 |
| S411 | 1 | 1 | 0 | 0 | 0 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds all
S4XXrules to the flake8-bandit plugin port.There is a lot of documentation to write, some tests can be expanded and implementation can probably be refactored to be more compact. As there is some discussion on whether this is actually useful. (See: #1646 (comment)), wanted to check which rules we want to have before I go through the process of polishing this up.
Test Plan
Fixtures for all rules based on
flake8-bandittestsIssue link
Refers: #1646