Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ repos:
typing_extensions,
wadler_lindig,
]

# Dead code https://github.com/jendrikseipp/vulture
- repo: https://github.com/jendrikseipp/vulture
rev: 'v2.14'
hooks:
- id: vulture
2 changes: 1 addition & 1 deletion main/graphql/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class IsAuthenticated(BasePermission):
message = "User is not authenticated"

@sync_to_async
def has_permission(self, source: typing.Any, info: Info, **_) -> bool:
def has_permission(self, source: typing.Any, info: Info, **_) -> bool: # noqa: Vulture
user = info.context.request.user
return bool(user and user.is_authenticated)
42 changes: 42 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
"django-mdeditor>=0.1.20",
"django-simple-captcha>=0.6.3",
"django-stubs>=5.1.3",
"vulture>=2.14",
]

[dependency-groups]
Expand Down Expand Up @@ -218,3 +219,44 @@ exclude_also = [
partial_branches = [
"if typing.TYPE_CHECKING:",
]

[tool.vulture]
# Exclude specific files and directories from being scanned
paths = ["."]
exclude = [
"venv",
".venv/*",
"*/migrations/*",
"*/tests/*",
"*/__pycache__/*",
"*/static/*",
"*/media/*",
"data/*",
"deploy/*",
"helm/*",
"typings/*"
]

# Ignore decorators commonly used in Django
ignore_decorators = [
"@receiver",
"@register.filter",
"@register.inclusion_tag",
"@register.simple_tag",
"@admin.action",
"@admin.display",
"@admin.register",
"@pytest.fixture",
]

# Ignore common Django-related object names
ignore_names = [
"*Config", # AppConfig subclasses
"*Middleware",
"clean_*",
"Meta",
"urlpatterns",
]
min_confidence = 90
# Sort results in size-ascending order
sort_by_size = true
11 changes: 11 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading