From 7eb6cb2407653ca9c6bb8d3c86f1e78f95efde29 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 22 Aug 2022 10:14:09 +0530 Subject: [PATCH] Update script that counts lines of code --- count-lines-of-code | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/count-lines-of-code b/count-lines-of-code index a4c82213a..f3fe66f4f 100755 --- a/count-lines-of-code +++ b/count-lines-of-code @@ -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())