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
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
exclude: '^docs/|/migrations/'
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: check-docstring-first
- id: check-merge-conflict
Expand Down Expand Up @@ -42,42 +42,42 @@ repos:
args: ['--prose-wrap=never', '--tab-width', '2', '--single-quote'] # Following django-cookiecutter

- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
rev: 2.3.2
hooks:
- id: poetry-check
- id: poetry-lock
args: ['--check', '--no-update']

- repo: https://github.com/adamchainz/django-upgrade
rev: '1.15.0'
rev: '1.30.0'
hooks:
- id: django-upgrade
args: ['--target-version', '4.2']

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py311-plus]

- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
rev: v2.6.0
hooks:
- id: pycln
args: [--config=pyproject.toml]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 8.0.1
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.12.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -92,27 +92,27 @@ repos:
args: [--config, ./pyproject.toml]

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
rev: v1.7.7
hooks:
- id: docformatter
args: [--in-place, --config, ./pyproject.toml]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.9.4
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ['bandit[toml]']

- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
rev: v1.36.4
hooks:
- id: djlint-reformat-django
args: ['--configuration', './pyproject.toml']
- id: djlint-django

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.19.1
hooks:
- id: mypy
args: [--config-file, ./pyproject.toml]
Expand Down
1 change: 1 addition & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
Expand Down
10 changes: 7 additions & 3 deletions lwmdb/management/commands/createfixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ def handle(self, *args, **kwargs):
)

# Block if non-allowed apps passed
exit(
f"App(s) not allowed: {[x for x in apps if not x in ALLOWED_APPS]}",
) if [x for x in apps if not x in ALLOWED_APPS] else None
(
exit(
f"App(s) not allowed: {[x for x in apps if not x in ALLOWED_APPS]}",
)
if [x for x in apps if not x in ALLOWED_APPS]
else None
)

for app in apps:
if app == "gazetteer":
Expand Down
10 changes: 7 additions & 3 deletions lwmdb/management/commands/loadfixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ def handle(self, *args, **kwargs):
)

# Block if non-allowed apps passed
exit(
f"App(s) not allowed: {[x for x in apps if not x in ALLOWED_APPS]}",
) if [x for x in apps if not x in ALLOWED_APPS] else None
(
exit(
f"App(s) not allowed: {[x for x in apps if not x in ALLOWED_APPS]}",
)
if [x for x in apps if not x in ALLOWED_APPS]
else None
)

for app in apps:
if app == "newspapers":
Expand Down
3 changes: 1 addition & 2 deletions lwmdb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,7 @@ def path_or_str_suffix(
return suffix


class DataSourceDownloadError(Exception):
...
class DataSourceDownloadError(Exception): ...


@dataclass
Expand Down
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""

import os
import sys

Expand Down
6 changes: 3 additions & 3 deletions mitchells/import_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ def create_mitchells_fixtures(self):
# Create mitchells_publication_for_linking (for newspapers)
mitchells_publication_for_linking = mitchells_entries.copy()
mitchells_publication_for_linking = mitchells_publication_for_linking[["NLP"]]
mitchells_publication_for_linking[
"entry"
] = mitchells_publication_for_linking.index
mitchells_publication_for_linking["entry"] = (
mitchells_publication_for_linking.index
)

mitchells_publication_for_linking.to_csv(
AUTO_FILE_LOCATIONS["mitchells_publication_for_linking"]
Expand Down
3 changes: 1 addition & 2 deletions newspapers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ def _sync_title_counts(self, force: bool = False) -> None:

SAS_ENV_VARIABLE = "FULLTEXT_SAS_TOKEN"

class TitleLengthError(Exception):
...
class TitleLengthError(Exception): ...

@property
def download_dir(self):
Expand Down
Loading