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$)" exclude: "(^Pipfile\\.lock$)"
# Python hooks # Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.0' rev: 'v0.3.2'
hooks: hooks:
- id: ruff - id: ruff
- repo: https://github.com/psf/black-pre-commit-mirror - 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 num_storage_paths = len(set(labels_storage_path) | {-1}) - 1
logger.debug( logger.debug(
"{} documents, {} tag(s), {} correspondent(s), " f"{docs_queryset.count()} documents, {num_tags} tag(s), {num_correspondents} correspondent(s), "
"{} document type(s). {} storage path(es)".format( f"{num_document_types} document type(s). {num_storage_paths} storage path(es)",
docs_queryset.count(),
num_tags,
num_correspondents,
num_document_types,
num_storage_paths,
),
) )
from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import CountVectorizer

View File

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

View File

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

View File

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