ruff: enable PLR rules and fix bug in my.github.gdpr._is_bot
This commit is contained in:
parent
b594377a59
commit
d0df8e8f2d
2 changed files with 17 additions and 1 deletions
|
@ -145,7 +145,7 @@ def _parse_repository(d: Dict) -> Event:
|
|||
def _is_bot(user: Optional[str]) -> bool:
|
||||
if user is None:
|
||||
return False
|
||||
return "[bot]" in "user"
|
||||
return "[bot]" in user
|
||||
|
||||
|
||||
def _parse_issue_comment(d: Dict) -> Event:
|
||||
|
|
16
ruff.toml
16
ruff.toml
|
@ -7,6 +7,10 @@ lint.extend-select = [
|
|||
"UP", # detect deprecated python stdlib stuff
|
||||
"FBT", # detect use of boolean arguments
|
||||
"RUF", # various ruff-specific rules
|
||||
|
||||
"PLR",
|
||||
# "S", # bandit (security checks) -- tends to be not very useful, lots of nitpicks
|
||||
# "DTZ", # datetimes checks -- complaining about missing tz and mostly false positives
|
||||
]
|
||||
|
||||
lint.ignore = [
|
||||
|
@ -41,4 +45,16 @@ lint.ignore = [
|
|||
###
|
||||
"RUF100", # unused noqa -- handle later
|
||||
"RUF012", # mutable class attrs should be annotated with ClassVar... ugh pretty annoying for user configs
|
||||
|
||||
### these are just nitpicky, we usually know better
|
||||
"PLR0911", # too many return statements
|
||||
"PLR0912", # too many branches
|
||||
"PLR0913", # too many function arguments
|
||||
"PLR0915", # too many statements
|
||||
"PLR1714", # consider merging multiple comparisons
|
||||
"PLR2044", # line with empty comment
|
||||
"PLR5501", # use elif instead of else if
|
||||
"PLR2004", # magic value in comparison -- super annoying in tests
|
||||
###
|
||||
"PLR0402", # import X.Y as Y -- TODO maybe consider enabling it, but double check
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue