papermario/tools/old/new_lines.py
lshamis ae66312d8c
Add Python linter to github actions (#1100)
* Add Python linter to github actions

* wip

* Add back splat_ext

* Format files

* C++ -> C

* format 2 files

* split workflow into separate file, line length 120, fix excludes

* -l 120 in ci

* update black locally and apply formatting changes

* pyproject.toject

---------

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2023-07-30 02:03:17 +09:00

16 lines
340 B
Python

from pathlib import Path
def parse_folder(path):
for entry in path.iterdir():
if entry.is_dir():
parse_folder(entry)
else:
fd = entry.read_text().splitlines()
if fd[-1] != "":
fd.append("")
entry.write_text("\n".join(fd))
parse_folder(Path("src"))