Skip to content

Commit

Permalink
ruff: Add more rules based on Zulip's config
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and tpike3 committed Feb 10, 2023
1 parent 71b4bd4 commit b05a04f
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
[tool.ruff]
select = ["E", "F", "I"]
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
select = [
# "ANN", # annotations TODO
"B", # bugbear
"C4", # comprehensions
"DTZ", # naive datetime
"E", # style errors
"F", # flakes
"I", # import sorting
"ISC", # string concatenation
"N", # naming
"PGH", # pygrep-hooks
"PIE", # miscellaneous
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor TODO
"PLW", # pylint warning
"Q", # quotes
"RUF", # Ruff
"S", # security
"SIM", # simplify
"T10", # debugger
"UP", # upgrade
"W", # style warnings
"YTT", # sys.version
]
# Ignore list taken from https://github.com/psf/black/blob/master/.flake8
# E203 Whitespace before ':'
# E266 Too many leading '#' for block comment
Expand All @@ -8,7 +33,12 @@ select = ["E", "F", "I"]
# But we don't specify them because ruff's Black already
# checks for it.
# See https://github.com/charliermarsh/ruff/issues/1842#issuecomment-1381210185
extend-ignore = ["E501"]
extend-ignore = [
"E501",
"S101", # Use of `assert` detected
"B017", # `assertRaises(Exception)` should be considered evil TODO
"PGH004", # Use specific rule codes when using `noqa` TODO
]
extend-exclude = ["docs", "build"]
# Hardcode to Python 3.8.
target-version = "py38"

0 comments on commit b05a04f

Please sign in to comment.