Skip to content

Commit 032bb2f

Browse files
committed
chores: update mainstream to v0.1.0-78
1 parent ad1da89 commit 032bb2f

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

hoshi-lang

Submodule hoshi-lang updated from 2619634 to 4028007

tools/line.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pathlib
2+
3+
code_lines = {}
4+
5+
def traverse(path: pathlib.Path = pathlib.Path(".")) -> None:
6+
global code_lines
7+
for child in path.iterdir():
8+
if child.is_dir() and not child.name.startswith(".") and child.name not in ["build", "cmake-build-debug", "cmake-build-release", "mimalloc"]:
9+
traverse(child)
10+
elif child.is_file():
11+
if child.suffix in ['.hoshi']:
12+
code_lines[child.name] = len(child.read_text().split('\n'))
13+
14+
15+
if __name__ == '__main__':
16+
traverse()
17+
for file_name, line_count in code_lines.items():
18+
print(f"{file_name}: {line_count} lines")
19+
print(f"Total lines of code: {sum(code_lines.values())}")

0 commit comments

Comments
 (0)