Run black on entire project

This commit is contained in:
Sumner Evans
2020-04-23 20:17:45 -06:00
parent e5b3e659ff
commit 0ed2c266d8
52 changed files with 2603 additions and 2917 deletions

View File

@@ -6,18 +6,18 @@ from pathlib import Path
from termcolor import cprint
todo_re = re.compile(r'#\s*TODO:?\s*')
accounted_for_todo = re.compile(r'#\s*TODO:?\s*\((#\d+)\)')
todo_re = re.compile(r"#\s*TODO:?\s*")
accounted_for_todo = re.compile(r"#\s*TODO:?\s*\((#\d+)\)")
def check_file(path: Path) -> bool:
print(f'Checking {path.absolute()}...') # noqa: T001
print(f"Checking {path.absolute()}...") # noqa: T001
file = path.open()
valid = True
for i, line in enumerate(file, start=1):
if todo_re.search(line) and not accounted_for_todo.search(line):
cprint(f'{i}: {line}', 'red', end='', attrs=['bold'])
cprint(f"{i}: {line}", "red", end="", attrs=["bold"])
valid = False
file.close()
@@ -25,7 +25,7 @@ def check_file(path: Path) -> bool:
valid = True
for path in Path('sublime').glob('**/*.py'):
for path in Path("sublime").glob("**/*.py"):
valid &= check_file(path)
print() # noqa: T001