Files
kitty-mirror/count-lines-of-code
Kovid Goyal ad03fa94b2 Update the list of nerd font names when updating other unicode data as well
No longer need to store the list of names in our source code
2025-05-21 13:19:27 +05:30

19 lines
730 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', '--list-file', '-'], input='\n'.join(all_files).encode())
raise SystemExit(cp.returncode)