ruff: add django rules

This commit is contained in:
Jelle van der Waa 2024-07-20 14:50:46 +02:00 committed by Jelle van der Waa
parent bdfcab6211
commit 34190c241d

View File

@ -5,6 +5,7 @@ select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DJ", # flake8-django
"E", # pycodestyle
"F", # pyflakes
"G", # flake8-logging-format
@ -27,4 +28,9 @@ ignore = [
"E731", # Do not assign a `lambda` expression, use a `def`
"B904", # Within an `except` clause, raise exceptions with `raise ... from err`
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
# TODO: add these one by one
"DJ001", # Avoid using `null=True` on string-based fields such as `CharField`
"DJ006", # Do not use `exclude` with `ModelForm`, use `fields` instead
"DJ008", # Model does not define `__str__` method
"DJ012", # Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `Meta` class should come before `get_absolute_url`
]