-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Ruff linter #34820
Closed
Closed
Ruff linter #34820
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ace063e
chore: Update testing.txt
awais786 aa3bf2e
chore: Update testing.txt
awais786 9900c57
Merge branch 'openedx:master' into master
awais786 cc88244
Merge branch 'openedx:master' into master
awais786 7b66aff
Merge branch 'openedx:master' into master
awais786 9feb540
Merge branch 'openedx:master' into master
awais786 a1bf662
Merge branch 'openedx:master' into master
awais786 c452e1a
fix: ruff shard removed
irtazaakram ac139ef
test: Adding ruff linter.
awais786 f4cd1fc
test: Adding ruff linter.
awais786 dc6624e
test: Adding check in GH.
awais786 b21e7de
Merge branch 'master' into ruff-linter
awais786 7b5eadd
chore: fixing yaml
awais786 bd9110e
Merge branch 'master' into ruff-linter
awais786 22e6bb3
chore: Update quality-checks.yml
awais786 6bcd60f
chore: Update quality-checks.yml
awais786 c11a749
chore: running make upgrade job.
awais786 bb9c47f
chore: running make upgrade job.
awais786 b27a1c4
chore: running make upgrade job.
awais786 8f7a511
chore: running make upgrade job.
awais786 0bd6018
Merge branch 'master' into ruff-linter
awais786 75789da
Merge branch 'master' into ruff-linter
awais786 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
select = [ | ||
"A001", # redefined-builtin | ||
"ARG001", # unused-argument | ||
"B002", # nonexistent-operator | ||
"B006", # dangerous-default-value | ||
"B012", # lost-exception | ||
"B014", # duplicate-except | ||
"B018", # expression-not-assigned | ||
"B018", # pointless-statement | ||
"B023", # cell-var-from-loop | ||
"D419", # empty-docstring | ||
"E401", # multiple-imports | ||
"E501", # line-too-long | ||
"E702", # multiple-statements | ||
"E703", # unnecessary-semicolon | ||
"E712", # singleton-comparison | ||
"E721", # unidiomatic-typecheck | ||
"E722", # bare-except | ||
"E999", # syntax-error | ||
"F401", # unused-import | ||
"F403", # wildcard-import | ||
"F404", # misplaced-future | ||
"F501", # truncated-format-string | ||
"F502", # format-needs-mapping | ||
"F504", # unused-format-string-key | ||
"F507", # unused-format-string-argument | ||
"F522", # too-many-format-args | ||
"F524", # missing-format-argument-key | ||
"F524", # missing-format-string-key | ||
"F524", # too-few-format-args | ||
"F525", # format-combined-specification | ||
"F601", # duplicate-key | ||
"F631", # assert-on-tuple | ||
"F702", # not-in-loop | ||
"F704", # yield-outside-function | ||
"F706", # return-outside-function | ||
"F811", # function-redefined | ||
"F811", # reimported | ||
"F821", # undefined-variable | ||
"F822", # undefined-all-variable | ||
"F841", # unused-variable | ||
"FIX004", # fixme | ||
"G", # logging-format-interpolation | ||
"G", # logging-fstring-interpolation | ||
"G", # logging-not-lazy | ||
"I001", # ungrouped-imports | ||
"I001", # wrong-import-order | ||
"N804", # bad-classmethod-argument | ||
"N805", # no-method-argument | ||
"N805", # no-self-argument | ||
"N815", # invalid-name | ||
"PGH001", # eval-used | ||
"PIE790", # unnecessary-pass | ||
"PLE0101", # return-in-init | ||
"PLE0116", # continue-in-finally | ||
"PLE0241", # duplicate-bases | ||
"PLE0302", # unexpected-special-method-signature | ||
"PLE0604", # invalid-all-object | ||
"PLE0704", # misplaced-bare-raise | ||
"PLE1205", # logging-too-many-args | ||
"PLE1206", # logging-too-few-args | ||
"PLE1310", # bad-str-strip-call | ||
"PLR0904", # too-many-public-methods | ||
"PLR0911", # too-many-return-statements | ||
"PLR0912", # too-many-branches | ||
"PLR0913", # too-many-arguments | ||
"PLR0915", # too-many-statements | ||
"PLR0916", # too-many-boolean-expressions | ||
"PLW0120", # useless-else-on-loop | ||
"PLW0406", # import-self | ||
"PLW0602", # global-variable-not-assigned | ||
"PLW0603", # global-statement | ||
"PLW0711", # binary-op-exception | ||
"PLW1514", # unspecified-encoding | ||
"RET502", # inconsistent-return-statements | ||
"RET505", # no-else-return | ||
"RET507", # no-else-continue | ||
"RET508", # no-else-break | ||
"S102", # exec-used | ||
"SIM118", # consider-iterating-dictionary | ||
"SIM208", # unneeded-not | ||
"UP004", # useless-object-inheritance | ||
"W292", # missing-final-newline | ||
"W605", # anomalous-backslash-in-string | ||
] | ||
|
||
ignore = [ | ||
"ARG001", # unused-argument | ||
"F841", # unused-variable | ||
"FIX004", # fixme | ||
"G", # logging-format-interpolation | ||
"G", # logging-fstring-interpolation | ||
"I001", # ungrouped-imports | ||
"I001", # wrong-import-order | ||
"N815", # invalid-name | ||
"PLR0904", # too-many-public-methods | ||
"PLR0911", # too-many-return-statements | ||
"PLR0912", # too-many-branches | ||
"PLR0913", # too-many-arguments | ||
"PLW0603", # global-statement | ||
"PLW1514", # unspecified-encoding | ||
"RET502", # inconsistent-return-statements | ||
"RET505", # no-else-return | ||
"RET507", # no-else-continue | ||
"RET508", # no-else-break | ||
"UP004", # useless-object-inheritance | ||
|
||
# enabled in pylint but failing in ruff because of too many inline suppressions | ||
"A001", # redefined-builtin | ||
"B006", # dangerous-default-value | ||
"B018", # expression-not-assigned | ||
"B018", # pointless-statement | ||
"B023", # cell-var-from-loop | ||
"E501", # line-too-long | ||
"E712", # singleton-comparison | ||
"E721", # unidiomatic-typecheck | ||
"E722", # bare-except | ||
"F403", # wildcard-import | ||
"F811", # function-redefined | ||
"F811", # reimported | ||
"F821", # undefined-variable | ||
"N804", # bad-classmethod-argument | ||
"N805", # no-method-argument | ||
"N805", # no-self-argument | ||
"PGH001", # eval-used | ||
"PIE790", # unnecessary-pass | ||
"PLR0915", # too-many-statements | ||
"PLW0602", # global-variable-not-assigned | ||
"SIM118", # consider-iterating-dictionary | ||
"F401", # unused-import | ||
] | ||
|
||
[lint.extend-per-file-ignores] | ||
# Also ignore `E402` in all `__init__.py` files. | ||
"__init__.py" = ["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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: would it make sense to move these configs to
pyproject.toml -> [tool.ruff]
, to start using a common place for such configurations?