Skip to content

Commit

Permalink
Update pre-commit hooks and run against all files
Browse files Browse the repository at this point in the history
  • Loading branch information
danialkeimasi committed Sep 25, 2023
1 parent 99b258a commit b190cc8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
12 changes: 6 additions & 6 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.3.0"
rev: "v4.4.0"
hooks:
- id: trailing-whitespace # trims trailing whitespace
args: [--markdown-linebreak-ext=md]
Expand All @@ -15,30 +15,30 @@ repos:
- id: check-merge-conflict # check for files that contain merge conflict strings

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.7.0"
rev: "1.15.0"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]

- repo: https://github.com/asottile/pyupgrade
rev: "v2.37.3"
rev: "v3.13.0"
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/pycqa/isort
rev: "5.10.1"
rev: "5.12.0"
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: "22.6.0"
rev: "23.9.1"
hooks:
- id: black

- repo: https://github.com/ikamensh/flynt
rev: "0.76"
rev: "1.0.1"
hooks:
- id: flynt
args: [--aggressive, --line-length, "120"]
7 changes: 2 additions & 5 deletions qsessions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,13 @@ def get_search_fields(self, request):
f"user__{getattr(User, 'USERNAME_EMAIL', 'email')}",
)

@admin.display(description=_("Is valid"), boolean=True)
def is_valid(self, obj):
return obj.expire_date > now()

is_valid.boolean = True
is_valid.short_description = _("Is valid")

@admin.display(description=_("Session data"))
def session_data_decoded(self, obj):
return format_html(
'<pre style="white-space: pre-wrap; max-width: 800px; display: inline-block; direction: ltr;">{}</pre>',
pformat(obj.get_decoded()),
)

session_data_decoded.short_description = _("Session data")
1 change: 0 additions & 1 deletion qsessions/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion qsessions/migrations/0002_session_created_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("qsessions", "0001_initial"),
]
Expand Down

1 comment on commit b190cc8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
qsessions
   admin.py55395%21, 42–43
   geoip.py27678%15, 21–23, 51–53
tests
   test_sessionstore.py99199%144
TOTAL4411098% 

Tests Skipped Failures Errors Time
48 0 💤 0 ❌ 0 🔥 4.984s ⏱️

Please sign in to comment.