-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SIM300: CONSTANT_CASE variables are improperly flagged for yoda viola…
…tion (#9164) ## Summary fixes #6956 details in issue Following an advice in #6956 (comment), this change separates expressions to 3 levels of "constant likelihood": * literals, empty dict and tuples... (definitely constant, level 2) * CONSTANT_CASE vars (probably constant, 1) * all other expressions (0) a comparison is marked yoda if the level is strictly higher on its left hand side following #6956 (comment) marking compound expressions of literals (e.g. `60 * 60` ) as constants this change current behaviour on `SomeClass().settings.SOME_CONSTANT_VALUE > (60 * 60)` in the fixture from error to ok
- Loading branch information
1 parent
cbe3bf9
commit 5d41c84
Showing
5 changed files
with
682 additions
and
268 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
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.