-
Notifications
You must be signed in to change notification settings - Fork 429
chore(ci): replace flake8 with Ruff as a linter #2495
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6b91f35
automation: adding ruff as linter
leandrodamascena a40b822
automation: adding CONTRIBUTING
leandrodamascena ca506e9
automation: removing pydoc
leandrodamascena 2e132e8
Merge branch 'develop' into ruff
leandrodamascena a5b3e7a
merge upstream
leandrodamascena a511901
merge upstream
leandrodamascena 094b121
addressing Heitorś feedback + enabling new rules
leandrodamascena cbcb771
Merging from develop
leandrodamascena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Enable rules. | ||
select = [ | ||
"A", | ||
"C4", | ||
"C90", | ||
"COM", | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#"D", # pydocstyle - not enabled temporarily | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"E", | ||
"ERA", | ||
"FA", | ||
"FIX", | ||
"F", | ||
"I", | ||
"ICN", | ||
"ISC", | ||
"PLE", | ||
"PLC", | ||
"PLR", | ||
"PLW", | ||
"PL", | ||
"PYI", | ||
"Q", | ||
"PTH", | ||
"TD", | ||
"W" | ||
] | ||
|
||
# Ignore specific rules | ||
ignore = [ | ||
"W291", # https://beta.ruff.rs/docs/rules/trailing-whitespace/ | ||
"PLR0913", # https://beta.ruff.rs/docs/rules/too-many-arguments/ | ||
"PLR2004", #https://beta.ruff.rs/docs/rules/magic-value-comparison/ | ||
"PLW0603", #https://beta.ruff.rs/docs/rules/global-statement/ | ||
"COM812", # Trailing comma missing - disabled temporarily | ||
heitorlessa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"PLC1901", # Compare-to-empty-string - disabled temporarily | ||
"ERA001", # Found commented-out code - disabled temporarily | ||
heitorlessa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"PLW", # Warning category - disabled temporarily | ||
"PLR", # Refactoring category - disabled temporarily | ||
"PLC", # Convention category - disabled temporarily | ||
"PLE", # Error category - disabled temporarily | ||
heitorlessa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"ISC", # flake8-implicit-str-concat - disabled temporarily | ||
"E501", # Line too long - disabled temporarily | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"I001", # isort - disabled temporarily | ||
] | ||
|
||
# Exclude files and directories | ||
exclude = ["docs", ".eggs", "setup.py", "example", ".aws-sam", ".git", "dist", ".md", ".yaml", "example/samconfig.toml", ".txt", ".ini"] | ||
|
||
# Maximum line length | ||
line-length = 120 | ||
|
||
|
||
#fix = true | ||
#fixable = ["I", "COM812", "W"] | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# See: https://github.com/astral-sh/ruff/issues/128 | ||
typing-modules = ["aws_lambda_powertools.utilities.parser.types"] | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[mccabe] | ||
# Maximum cyclomatic complexity | ||
max-complexity = 15 | ||
|
||
[pylint] | ||
# Maximum number of nested blocks | ||
max-branches = 15 | ||
# Maximum number of if statements in a function | ||
max-statements = 70 | ||
|
||
[isort] | ||
split-on-trailing-comma = true | ||
leandrodamascena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[per-file-ignores] | ||
# Ignore specific rules for specific files | ||
"tests/e2e/utils/data_builder/__init__.py" = ["F401"] | ||
"tests/e2e/utils/data_fetcher/__init__.py" = ["F401"] | ||
"aws_lambda_powertools/utilities/data_classes/s3_event.py" = ["A003"] |
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.
Uh oh!
There was an error while loading. Please reload this page.