Updates pre-commit hook versions and runs it against all files

This commit is contained in:
Trenton H 2024-03-12 07:27:57 -07:00
parent fc9f69965f
commit b78e3b0b00
5 changed files with 6 additions and 20 deletions

View File

@ -47,7 +47,7 @@ repos:
exclude: "(^Pipfile\\.lock$)"
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.0'
rev: 'v0.3.2'
hooks:
- id: ruff
- repo: https://github.com/psf/black-pre-commit-mirror

View File

@ -237,14 +237,8 @@ class DocumentClassifier:
num_storage_paths = len(set(labels_storage_path) | {-1}) - 1
logger.debug(
"{} documents, {} tag(s), {} correspondent(s), "
"{} document type(s). {} storage path(es)".format(
docs_queryset.count(),
num_tags,
num_correspondents,
num_document_types,
num_storage_paths,
),
f"{docs_queryset.count()} documents, {num_tags} tag(s), {num_correspondents} correspondent(s), "
f"{num_document_types} document type(s). {num_storage_paths} storage path(es)",
)
from sklearn.feature_extraction.text import CountVectorizer

View File

@ -130,9 +130,7 @@ def set_checksums(apps, schema_editor):
fg="red",
),
code=colourise(
" $ echo 'DELETE FROM documents_document WHERE id = {pk};' | ./manage.py dbshell".format(
pk=document.pk,
),
f" $ echo 'DELETE FROM documents_document WHERE id = {document.pk};' | ./manage.py dbshell",
fg="green",
),
line=colourise("\n{}\n".format("=" * 80), fg="white", opts=("bold",)),

View File

@ -290,9 +290,7 @@ class TestMigrations(TransactionTestCase):
assert (
self.migrate_from and self.migrate_to
), "TestCase '{}' must define migrate_from and migrate_to properties".format(
type(self).__name__,
)
), f"TestCase '{type(self).__name__}' must define migrate_from and migrate_to properties"
self.migrate_from = [(self.app, self.migrate_from)]
if self.dependencies is not None:
self.migrate_from.extend(self.dependencies)

View File

@ -45,11 +45,7 @@ class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
self.assertEqual(
result,
actual_result,
"strip_exceess_whitespace({}) != '{}', but '{}'".format(
source,
result,
actual_result,
),
f"strip_exceess_whitespace({source}) != '{result}', but '{actual_result}'",
)
def test_get_text_from_pdf(self):