Skip to content

Commit

Permalink
refactor!(ruff): Run all automated fixes as of ruff 0.3.4
Browse files Browse the repository at this point in the history
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .

Fixed 4 errors:
- docs/conf.py:
    1 × RET505 (superfluous-else-return)
- src/django_slugify_processor/templatetags/slugify_processor.py:
    1 × TID252 (relative-imports)
- tests/test_test_project.py:
    2 × PT023 (pytest-incorrect-mark-parentheses-style)
  • Loading branch information
tony committed Mar 24, 2024
1 parent 289198a commit b3233a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions docs/conf.py
Expand Up @@ -189,15 +189,14 @@ def linkcode_resolve(domain: str, info: t.Dict[str, str]) -> t.Union[None, str]:
fn,
linespec,
)
else:
return "{}/blob/v{}/{}/{}/{}{}".format(
about["__github__"],
about["__version__"],
"src",
about["__package_name__"],
fn,
linespec,
)
return "{}/blob/v{}/{}/{}/{}{}".format(
about["__github__"],
about["__version__"],
"src",
about["__package_name__"],
fn,
linespec,
)


def remove_tabs_js(app: "Sphinx", exc: Exception) -> None:
Expand Down
Expand Up @@ -3,7 +3,7 @@
from django import template
from django.template.defaultfilters import stringfilter

from ..text import slugify as _slugify
from django_slugify_processor.text import slugify as _slugify

register = template.Library()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_test_project.py
Expand Up @@ -6,7 +6,7 @@
from django.apps import apps


@pytest.mark.django_db
@pytest.mark.django_db()
def test_models_passthrough(settings: t.Any) -> None:
"""django-slugify-processor defaults to django's behavior if not set."""
MyModel = apps.get_model("test_app.MyModel")
Expand All @@ -19,7 +19,7 @@ def test_models_passthrough(settings: t.Any) -> None:
assert m.django_extensions_slug == expected


@pytest.mark.django_db
@pytest.mark.django_db()
def test_models(settings: t.Any) -> None:
"""django-slugify-processor uses SLUGIFY_PROCESSORS if set."""
settings.SLUGIFY_PROCESSORS = ["test_app.coding.slugify_programming"]
Expand Down

0 comments on commit b3233a2

Please sign in to comment.