Skip to content

Instantly share code, notes, and snippets.

@pantafive
Last active January 9, 2023 08:17
Show Gist options
  • Save pantafive/473ffb0d8b6939c518e8353e12535fc7 to your computer and use it in GitHub Desktop.
Save pantafive/473ffb0d8b6939c518e8353e12535fc7 to your computer and use it in GitHub Desktop.
ruff
[tool.ruff]
line-length = 120
select = [
# "D", # pydocstyle
"F", # Pyflakes
"I", # isort
"N", # pep8-naming
"RUF", # Ruff-specific rules
"UP", # pyupgrade
# pycodestyle
"E", # pycodestyle errors
"W", # pycodestyle warnings
# flake8
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C", # flake8-comprehensions
"C4", # flake8-comprehensions
# "DTZ", # flake8-datetimez
"EM", # flake8-errmsg
# "FBT", # flake8-boolean-trap
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TID", # flake8-tidy-imports
"YTT", # flake8-2020
# "ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
# Pylint
"PLC", "PLE", "PLR", "PLW",
]
ignore = [
"ANN101", # Missing type annotation for self in a class method
"ANN102", # Missing type annotation for cls in a classmethod
"C408", # Unnecessary `dict` call
"RET504", # Unnecessary variable assignment before `return` statement
"RUF002", # Docstring contains ambiguous unicode character
"RUF003", # Comment contains ambiguous unicode character
"UP006", # Use `list` instead of `List` for type annotations
"UP007", # Use `X | Y` for type annotations
]
[tool.ruff.isort]
combine-as-imports = false
force-single-line = true
known-first-party = ["app"]
order-by-type = true
[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment