Run black on entire project
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user