mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Chore: add pre-commit hook for codespell (#5324)
This commit is contained in:
		| @@ -204,10 +204,10 @@ class DocumentClassifier: | ||||
|         ) and self.last_auto_type_hash == hasher.digest(): | ||||
|             return False | ||||
|  | ||||
|         # substract 1 since -1 (null) is also part of the classes. | ||||
|         # subtract 1 since -1 (null) is also part of the classes. | ||||
|  | ||||
|         # union with {-1} accounts for cases where all documents have | ||||
|         # correspondents and types assigned, so -1 isnt part of labels_x, which | ||||
|         # correspondents and types assigned, so -1 isn't part of labels_x, which | ||||
|         # it usually is. | ||||
|         num_correspondents = len(set(labels_correspondent) | {-1}) - 1 | ||||
|         num_document_types = len(set(labels_document_type) | {-1}) - 1 | ||||
|   | ||||
| @@ -33,7 +33,7 @@ from documents.utils import copy_file_with_basic_stats | ||||
| # - XX MON ZZZZ with XX being 1 or 2 and ZZZZ being 4 digits. MONTH is 3 letters | ||||
| # - XXPP MONTH ZZZZ with XX being 1 or 2 and PP being 2 letters and ZZZZ being 4 digits | ||||
|  | ||||
| # TODO: isnt there a date parsing library for this? | ||||
| # TODO: isn't there a date parsing library for this? | ||||
|  | ||||
| DATE_REGEX = re.compile( | ||||
|     r"(\b|(?!=([_-])))([0-9]{1,2})[\.\/-]([0-9]{1,2})[\.\/-]([0-9]{4}|[0-9]{2})(\b|(?=([_-])))|" | ||||
| @@ -113,8 +113,6 @@ def get_parser_class_for_mime_type(mime_type: str) -> Optional[type["DocumentPar | ||||
|  | ||||
|     options = [] | ||||
|  | ||||
|     # Sein letzter Befehl war: KOMMT! Und sie kamen. Alle. Sogar die Parser. | ||||
|  | ||||
|     for response in document_consumer_declaration.send(None): | ||||
|         parser_declaration = response[1] | ||||
|         supported_mime_types = parser_declaration["mime_types"] | ||||
|   | ||||
| @@ -414,7 +414,7 @@ class TestClassifier(DirectoriesMixin, TestCase): | ||||
|         ) | ||||
|         doc2 = Document.objects.create( | ||||
|             title="doc2", | ||||
|             content="this is a document from noone", | ||||
|             content="this is a document from no one", | ||||
|             checksum="B", | ||||
|         ) | ||||
|  | ||||
|   | ||||
| @@ -665,7 +665,7 @@ class TestConsumer(DirectoriesMixin, FileSystemAssertsMixin, TestCase): | ||||
|     @override_settings(FILENAME_FORMAT="{correspondent}/{title}") | ||||
|     @mock.patch("documents.signals.handlers.generate_unique_filename") | ||||
|     def testFilenameHandlingUnstableFormat(self, m): | ||||
|         filenames = ["this", "that", "now this", "i cant decide"] | ||||
|         filenames = ["this", "that", "now this", "i cannot decide"] | ||||
|  | ||||
|         def get_filename(): | ||||
|             f = filenames.pop() | ||||
|   | ||||
| @@ -223,7 +223,7 @@ class TestMail( | ||||
|         attachments: Union[int, list[_AttachmentDef]] = 1, | ||||
|         body: str = "", | ||||
|         subject: str = "the subject", | ||||
|         from_: str = "noone@mail.com", | ||||
|         from_: str = "no_one@mail.com", | ||||
|         to: Optional[list[str]] = None, | ||||
|         seen: bool = False, | ||||
|         flagged: bool = False, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon