Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit repos #1478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
Expand All @@ -19,12 +19,12 @@ repos:
- "--fix=lf"
- id: trailing-whitespace
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.22.1
hooks:
- id: django-upgrade
args: [--target-version, "3.1"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.19.0
hooks:
- id: pyupgrade
args: ["--py39"]
Expand All @@ -46,7 +46,7 @@ repos:
hooks:
- id: checkmake
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.7.3
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion will_of_the_prophets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Butthole(TimeFramedModel):

def clean(self): # noqa: ANN201, D102
if self.start_square == self.end_square:
msg = "A butthole cannot start and end in the " "same square."
msg = "A butthole cannot start and end in the same square."
raise ValidationError(msg)

return super().clean()
Expand Down
9 changes: 4 additions & 5 deletions will_of_the_prophets/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,12 @@
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": (
"django.contrib.auth.password_validation"
".UserAttributeSimilarityValidator"
"django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
)
},
{"NAME": ("django.contrib.auth.password_validation" ".MinimumLengthValidator")},
{"NAME": ("django.contrib.auth.password_validation" ".CommonPasswordValidator")},
{"NAME": ("django.contrib.auth.password_validation" ".NumericPasswordValidator")},
{"NAME": ("django.contrib.auth.password_validation.MinimumLengthValidator")},
{"NAME": ("django.contrib.auth.password_validation.CommonPasswordValidator")},
{"NAME": ("django.contrib.auth.password_validation.NumericPasswordValidator")},
]


Expand Down
4 changes: 2 additions & 2 deletions will_of_the_prophets/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
logger = logging.getLogger(__name__)


@pytest.fixture()
def rolls() -> None: # noqa: PT004
@pytest.fixture
def rolls() -> None:
"""Generate nine rolls on the first nine days of July 2369."""
for number in range(1, 10):
embargo = pytz.utc.localize(
Expand Down
16 changes: 8 additions & 8 deletions will_of_the_prophets/tests/models/butthole/test_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_no_start_or_end() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=None)
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=datetime(1980, 1, 1), end=None) # noqa: DTZ001
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_future() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=datetime(2020, 1, 1), end=None) # noqa: DTZ001
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_past() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=datetime(1980, 1, 1)) # noqa: DTZ001
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_future() -> None: # noqa: D103
butthole = baker.make(models.Butthole, start=None, end=datetime(2020, 1, 1)) # noqa: DTZ001
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_past() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand All @@ -46,7 +46,7 @@ def test_start_and_end_in_past() -> None: # noqa: D103
assert butthole not in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past_end_in_future() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand All @@ -56,7 +56,7 @@ def test_start_in_past_end_in_future() -> None: # noqa: D103
assert butthole in models.Butthole.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_future() -> None: # noqa: D103
butthole = baker.make(
models.Butthole,
Expand Down
16 changes: 8 additions & 8 deletions will_of_the_prophets/tests/models/special_square/test_active.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_no_start_or_end() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare, start=None, end=None, type__image=""
)
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -25,7 +25,7 @@ def test_start_in_past() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -38,7 +38,7 @@ def test_start_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -51,7 +51,7 @@ def test_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -62,7 +62,7 @@ def test_end_in_future() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_past() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -75,7 +75,7 @@ def test_start_and_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_in_past_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand All @@ -86,7 +86,7 @@ def test_start_in_past_end_in_future() -> None: # noqa: D103
assert special_square in models.SpecialSquare.objects.active(datetime(2000, 1, 1)) # noqa: DTZ001


@pytest.mark.django_db()
@pytest.mark.django_db
def test_start_and_end_in_future() -> None: # noqa: D103
special_square = baker.make(
models.SpecialSquare,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_no_end() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -15,7 +15,7 @@ def test_one_square_no_end() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -29,7 +29,7 @@ def test_one_square_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -43,7 +43,7 @@ def test_one_square_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_all_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -63,7 +63,7 @@ def test_many_squares_all_archived() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_none_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -79,7 +79,7 @@ def test_many_squares_none_archived() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_some_archived() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from will_of_the_prophets import models


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_no_start_or_end() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -15,7 +15,7 @@ def test_one_square_no_start_or_end() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -29,7 +29,7 @@ def test_one_square_start_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -43,7 +43,7 @@ def test_one_square_start_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -57,7 +57,7 @@ def test_one_square_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -71,7 +71,7 @@ def test_one_square_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_and_end_in_past() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -85,7 +85,7 @@ def test_one_square_start_and_end_in_past() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_in_past_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -99,7 +99,7 @@ def test_one_square_start_in_past_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_one_square_start_and_end_in_future() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand All @@ -113,7 +113,7 @@ def test_one_square_start_and_end_in_future() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_all_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand All @@ -140,7 +140,7 @@ def test_many_squares_all_active() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_none_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_many_squares_none_active() -> None: # noqa: D103
)


@pytest.mark.django_db()
@pytest.mark.django_db
def test_many_squares_some_active() -> None: # noqa: D103
special_square_type = baker.make(models.SpecialSquareType, image="")
baker.make(models.SpecialSquare, start=None, end=None, type=special_square_type)
Expand Down
4 changes: 2 additions & 2 deletions will_of_the_prophets/tests/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import pytest


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.parametrize("url", ["/", "/roll_frequency/"])
def test_public(client, url) -> None: # noqa: ANN001
"""Test that pages do not require authorization."""
response = client.get(url, secure=True)
assert response.status_code == 200


@pytest.mark.django_db()
@pytest.mark.django_db
@pytest.mark.parametrize("url", ["/roll/"])
def test_requires_auth(client, admin_client, url) -> None: # noqa: ANN001
"""Test that pages require authorization."""
Expand Down
Loading