Files
FWS-Kitty/count-lines-of-code
T
BlackAngelTV 7e7d249099 chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty,
vendored at upstream commit 91fb38a without its git history.
2026-11-04 11:20:47 +01:00

18 lines
732 B
Python
Executable File

#!/usr/bin/env python
import subprocess
ls_files = subprocess.check_output(['git', 'ls-files']).decode('utf-8')
all_files = set(ls_files.splitlines())
all_files.discard('')
for attr in ('linguist-generated', 'linguist-vendored'):
cp = subprocess.run(['git', 'check-attr', attr, '--stdin'], check=True, stdout=subprocess.PIPE, input='\n'.join(all_files).encode('utf-8'))
for line in cp.stdout.decode().splitlines():
if line.endswith(' true'):
fname = line.split(':', 1)[0]
all_files.discard(fname)
all_files -= {'gen/rowcolumn-diacritics.txt'}
cp = subprocess.run(['cloc', '--force-lang=HLSL,slang', '--list-file', '-'], input='\n'.join(all_files).encode())
raise SystemExit(cp.returncode)