From 34190c241dba48ca859e55b4425018317172efbd Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Sat, 20 Jul 2024 14:50:46 +0200 Subject: [PATCH] ruff: add django rules --- ruff.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruff.toml b/ruff.toml index 4d85bad7..71e20fe2 100644 --- a/ruff.toml +++ b/ruff.toml @@ -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` ]