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-02-08 09:39:14 +03:00
|
|
|
cp = subprocess.run(['git', 'check-attr', 'linguist-generated', '--stdin'],
|
2023-09-24 13:14:40 +03:00
|
|
|
check=True, stdout=subprocess.PIPE, input='\n'.join(all_files).encode('utf-8'))
|
2023-02-08 09:39:14 +03:00
|
|
|
for line in cp.stdout.decode().splitlines():
|
|
|
|
if line.endswith(' true'):
|
2023-09-24 13:14:40 +03:00
|
|
|
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)
|