Apply formatting

This commit is contained in:
Chocobo1 2024-03-17 15:39:31 +08:00
commit 47c38e8d91
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 61 additions and 43 deletions

View file

@ -30,6 +30,7 @@ from typing import Optional, Sequence
import argparse
import re
def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check')
@ -47,12 +48,12 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
for line in file:
if (match := regex.match(line)) is not None:
error_buffer += str(f"Defect file: \"{filename}\"\n"
f"Line: {line_counter}\n"
f"Column span: {match.span()}\n"
f"Part: \"{match.group()}\"\n\n")
f"Line: {line_counter}\n"
f"Column span: {match.span()}\n"
f"Part: \"{match.group()}\"\n\n")
line_counter += 1
except UnicodeDecodeError as error:
except UnicodeDecodeError:
# not a text file, skip
continue
@ -64,5 +65,6 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
return 0
if __name__ == '__main__':
exit(main())