Chore: Adds additional rules for Ruff linter (#5660)

This commit is contained in:
Trenton H
2024-02-05 13:46:59 -08:00
committed by GitHub
parent d0091ce02c
commit 9943f36be3
13 changed files with 117 additions and 99 deletions

View File

@@ -69,8 +69,6 @@ class Command(ProgressBarMixin, BaseCommand):
def handle(self, *args, **options):
self.handle_progress_bar_mixin(**options)
# Detect if we support color
color = self.style.ERROR("test") != "test"
if options["inbox_only"]:
queryset = Document.objects.filter(tags__is_inbox_tag=True)
@@ -96,7 +94,8 @@ class Command(ProgressBarMixin, BaseCommand):
use_first=options["use_first"],
suggest=options["suggest"],
base_url=options["base_url"],
color=color,
stdout=self.stdout,
style_func=self.style,
)
if options["document_type"]:
@@ -108,7 +107,8 @@ class Command(ProgressBarMixin, BaseCommand):
use_first=options["use_first"],
suggest=options["suggest"],
base_url=options["base_url"],
color=color,
stdout=self.stdout,
style_func=self.style,
)
if options["tags"]:
@@ -119,7 +119,8 @@ class Command(ProgressBarMixin, BaseCommand):
replace=options["overwrite"],
suggest=options["suggest"],
base_url=options["base_url"],
color=color,
stdout=self.stdout,
style_func=self.style,
)
if options["storage_path"]:
set_storage_path(
@@ -130,5 +131,6 @@ class Command(ProgressBarMixin, BaseCommand):
use_first=options["use_first"],
suggest=options["suggest"],
base_url=options["base_url"],
color=color,
stdout=self.stdout,
style_func=self.style,
)

View File

@@ -19,7 +19,7 @@ def _process_document(doc_id):
if parser_class:
parser = parser_class(logging_group=None)
else:
print(f"{document} No parser for mime type {document.mime_type}")
print(f"{document} No parser for mime type {document.mime_type}") # noqa: T201
return
try: