diff --git a/debug_toolbar/panels/templates/panel.py b/debug_toolbar/panels/templates/panel.py index e63417fa9..f8c9242ca 100644 --- a/debug_toolbar/panels/templates/panel.py +++ b/debug_toolbar/panels/templates/panel.py @@ -154,10 +154,9 @@ def process_context_list(self, context_layers): # QuerySet would trigger the database: user can run the # query from SQL Panel elif isinstance(value, (QuerySet, RawQuerySet)): - temp_layer[key] = "<<{} of {}>>".format( - value.__class__.__name__.lower(), - value.model._meta.label, - ) + temp_layer[ + key + ] = f"<<{value.__class__.__name__.lower()} of {value.model._meta.label}>>" else: token = allow_sql.set(False) # noqa: FBT003 try: diff --git a/pyproject.toml b/pyproject.toml index 65a0bee1f..5f7abf41e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,44 +53,28 @@ path = "debug_toolbar/__init__.py" [tool.ruff] extend-select = [ - # pyflakes, pycodestyle - "F", "E", "W", - # mmcabe - # "C90", - # isort - "I", - # pep8-naming - # "N", - # pyupgrade - "UP", - # flake8-2020 - # "YTT", - # flake8-boolean-trap - "FBT", - # flake8-bugbear - "B", - # flake8-comprehensions - "C4", - # flake8-django - "DJ", - # flake8-pie - "PIE", - # flake8-simplify - "SIM", - # flake8-gettext - "INT", - # pygrep-hooks - "PGH", - # pylint - # "PL", - # unused noqa - "RUF100", + "ASYNC", # flake8-async + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "C90", # McCabe cyclomatic complexity + "DJ", # flake8-django + "E", # pycodestyle errors + "F", # Pyflakes + "FBT", # flake8-boolean-trap + "I", # isort + "INT", # flake8-gettext + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "RUF100", # Unused noqa directive + "SIM", # flake8-simplify + "SLOT", # flake8-slots + "UP", # pyupgrade + "W", # pycodestyle warnings ] extend-ignore = [ - # Allow zip() without strict= - "B905", - # No line length errors - "E501", + "B905", # Allow zip() without strict= + "E501", # Ignore line length violations + "SIM108", # Use ternary operator instead of if-else-block ] fix = true show-fixes = true @@ -100,14 +84,12 @@ target-version = "py38" combine-as-imports = true [tool.ruff.mccabe] -max-complexity = 15 +max-complexity = 16 [tool.ruff.per-file-ignores] "*/migrat*/*" = [ - # Allow using PascalCase model names in migrations - "N806", - # Ignore the fact that migration files are invalid module names - "N999", + "N806", # Allow using PascalCase model names in migrations + "N999", # Ignore the fact that migration files are invalid module names ] [tool.coverage.html]