Update script that counts lines of code

This commit is contained in:
Kovid Goyal 2022-08-22 10:14:09 +05:30
parent ce3062cbde
commit 7eb6cb2407
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -23,8 +23,14 @@ kittens/diff/options/types.py
kittens/diff/options/parse.py
'''
ignored = []
for line in subprocess.check_output(['git', 'status', '--ignored', '--porcelain']).decode().splitlines():
if line.startswith('!! '):
ignored.append(line[3:])
files_to_exclude += '\n'.join(ignored)
p = subprocess.Popen([
'cloc', '--exclude-list-file', '/dev/stdin', 'kitty', 'kittens'
'cloc', '--exclude-list-file', '/dev/stdin', 'kitty', 'kittens', 'tools',
], stdin=subprocess.PIPE)
p.communicate(files_to_exclude.encode('utf-8'))
raise SystemExit(p.wait())