2019-10-17 12:49:13 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
|
2023-09-24 13:14:40 +03:00
|
|
|
ls_files = subprocess.check_output([ 'git', 'ls-files']).decode('utf-8')
|
|
|
|
all_files = set(ls_files.splitlines())
|
|
|
|
all_files.discard('')
|
2023-11-14 07:42:03 +03:00
|
|
|
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)
|
2022-08-22 07:44:09 +03:00
|
|
|
|
2023-10-14 05:34:37 +03:00
|
|
|
all_files -= {'gen/nerd-fonts-glyphs.txt', 'gen/rowcolumn-diacritics.txt'}
|
2023-09-24 13:14:40 +03:00
|
|
|
cp = subprocess.run(['cloc', '--list-file', '-'], input='\n'.join(all_files).encode())
|
|
|
|
raise SystemExit(cp.returncode)
|