| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| if keyword := re.search( | ||
| r"\b(else if|if|while|for|switch)" # These have parens | ||
| r"\s*\(.*\)\s*(?:\[\[(?:un)?likely\]\]\s*)?{\s*[^\s\\};]", | ||
| line, | ||
| ): | ||
| error( | ||
| filename, | ||
| linenum, | ||
| "whitespace/newline", | ||
| 5, | ||
| f"Controlled statements inside brackets of {keyword.group(1)} clause" | ||
| " should be on a separate line", | ||
| if ( | ||
| keyword := re.search( | ||
| r"\b(else if|if|while|for|switch)" # These have parens | ||
| r"\s*\(.*\)\s*(?:\[\[(?:un)?likely\]\]\s*)?{\s*[^\s\\};]", | ||
| line, | ||
| ) | ||
| ) or ( | ||
| keyword := re.search( | ||
| r"\b(else|do|try)" # These don't have parens | ||
| r"\s*(?:\[\[(?:un)?likely\]\]\s*)?{\s*[^\s\\}]", | ||
| line, |
There was a problem hiding this comment.
I wonder why it put everything in brackets...
Sorry, something went wrong.
There was a problem hiding this comment.
Assignment Operator may require parentheses. Also there is a RUF rule that adds parens to clarify precedence between and, or, not.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://docs.astral.sh/ruff/rules/#flake8-simplify-sim