From b5780cf27fb7096f982e141f02a33a69e1590b32 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 17:34:28 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- debug_toolbar/panels/templates/panel.py | 2 +- pyproject.toml | 41 ++++++++++++++----------- tests/panels/test_sql.py | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/debug_toolbar/panels/templates/panel.py b/debug_toolbar/panels/templates/panel.py index c0c6246b2..81d7e5fad 100644 --- a/debug_toolbar/panels/templates/panel.py +++ b/debug_toolbar/panels/templates/panel.py @@ -158,7 +158,7 @@ def process_context_list(self, context_layers): f"<<{value.__class__.__name__.lower()} of {value.model._meta.label}>>" ) else: - token = allow_sql.set(False) # noqa: FBT003 + token = allow_sql.set(False) try: saferepr(value) # this MAY trigger a db query except SQLQueryTriggered: diff --git a/pyproject.toml b/pyproject.toml index 5e8a47516..56e0b0aca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,9 +8,9 @@ requires = [ name = "django-debug-toolbar" description = "A configurable set of panels that display various debug information about the current request/response." readme = "README.rst" -license = {text = "BSD-3-Clause"} +license = { text = "BSD-3-Clause" } authors = [ - { name = "Rob Hudson" }, + { name = "Rob Hudson" }, ] requires-python = ">=3.8" classifiers = [ @@ -35,15 +35,15 @@ dynamic = [ "version", ] dependencies = [ - "Django>=4.2.9", + "django>=4.2.9", "sqlparse>=0.2", ] -[project.urls] -Download = "https://pypi.org/project/django-debug-toolbar/" -Homepage = "https://github.com/jazzband/django-debug-toolbar" - +urls.Download = "https://pypi.org/project/django-debug-toolbar/" +urls.Homepage = "https://github.com/jazzband/django-debug-toolbar" [tool.hatch.build.targets.wheel] -packages = ["debug_toolbar"] +packages = [ + "debug_toolbar", +] [tool.hatch.version] path = "debug_toolbar/__init__.py" @@ -53,6 +53,9 @@ fix = true show-fixes = true target-version = "py38" +[tool.ruff.lint.mccabe] +max-complexity = 16 + [tool.ruff.lint] extend-select = [ "ASYNC", # flake8-async @@ -79,18 +82,15 @@ extend-ignore = [ "SIM108", # Use ternary operator instead of if-else-block ] -[tool.ruff.lint.isort] -combine-as-imports = true - -[tool.ruff.lint.mccabe] -max-complexity = 16 - [tool.ruff.lint.per-file-ignores] "*/migrat*/*" = [ - "N806", # Allow using PascalCase model names in migrations - "N999", # Ignore the fact that migration files are invalid module names + "N806", # Allow using PascalCase model names in migrations + "N999", # Ignore the fact that migration files are invalid module names ] +[tool.ruff.lint.isort] +combine-as-imports = true + [tool.coverage.html] skip_covered = true skip_empty = true @@ -98,10 +98,15 @@ skip_empty = true [tool.coverage.run] branch = true parallel = true -source = ["debug_toolbar"] +source = [ + "debug_toolbar", +] [tool.coverage.paths] -source = ["src", ".tox/*/site-packages"] +source = [ + "src", + ".tox/*/site-packages", +] [tool.coverage.report] # Update coverage badge link in README.rst when fail_under changes diff --git a/tests/panels/test_sql.py b/tests/panels/test_sql.py index 932a0dd92..48c9e3845 100644 --- a/tests/panels/test_sql.py +++ b/tests/panels/test_sql.py @@ -126,7 +126,7 @@ async def test_cursor_wrapper_asyncio_ctx(self, mock_patch_cursor_wrapper): await sync_to_async(sql_call)() async def task(): - sql_tracking.allow_sql.set(False) # noqa: FBT003 + sql_tracking.allow_sql.set(False) # By disabling sql_tracking.allow_sql, we are indicating that any # future SQL queries should be stopped. If SQL query occurs, # it raises an exception.