Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pre-commit-ci-update-config'
Browse files Browse the repository at this point in the history
* origin/pre-commit-ci-update-config:
  [pre-commit.ci] auto fixes from pre-commit.com hooks
  [pre-commit.ci] pre-commit autoupdate
  • Loading branch information
matthiask committed May 27, 2024
2 parents 25c860e + 2990290 commit 97b49d1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 32 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: doc8
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.17.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
Expand All @@ -32,7 +32,7 @@ repos:
args:
- --trailing-comma=es5
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.0.0
rev: v9.3.0
hooks:
- id: eslint
additional_dependencies:
Expand All @@ -44,16 +44,16 @@ repos:
args:
- --fix
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.7'
rev: 'v0.4.5'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.18
hooks:
- id: validate-pyproject
2 changes: 1 addition & 1 deletion debug_toolbar/panels/templates/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
49 changes: 24 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -35,32 +35,32 @@ 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.sdist]
# Jazzband's release process is limited to 2.2 metadata
core-metadata-version = "2.2"

[tool.hatch.build.targets.wheel]
packages = ["debug_toolbar"]
packages = [
"debug_toolbar",
]
# Jazzband's release process is limited to 2.2 metadata
core-metadata-version = "2.2"

[tool.hatch.version]
path = "debug_toolbar/__init__.py"

[tool.ruff]
fix = true
show-fixes = true
target-version = "py38"

[tool.ruff.lint]
extend-select = [
fix = true
show-fixes = true
lint.extend-select = [
"ASYNC", # flake8-async
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand All @@ -79,23 +79,17 @@ extend-select = [
"UP", # pyupgrade
"W", # pycodestyle warnings
]
extend-ignore = [
lint.extend-ignore = [
"B905", # Allow zip() without strict=
"E501", # Ignore line length violations
"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
lint.per-file-ignores."*/migrat*/*" = [
"N806", # Allow using PascalCase model names in migrations
"N999", # Ignore the fact that migration files are invalid module names
]
lint.isort.combine-as-imports = true
lint.mccabe.max-complexity = 16

[tool.coverage.html]
skip_covered = true
Expand All @@ -104,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
Expand Down
2 changes: 1 addition & 1 deletion tests/panels/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 97b49d1

Please sign in to comment.