mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
hotfix: make the line counter correct
This commit is contained in:
3
sz.py
3
sz.py
@@ -16,8 +16,7 @@ def gen_stats(base_path="."):
|
||||
relfilepath = os.path.relpath(filepath, base_path)
|
||||
with tokenize.open(filepath) as file_:
|
||||
tokens = [t for t in tokenize.generate_tokens(file_.readline) if t.type in TOKEN_WHITELIST]
|
||||
#token_count, line_count = len(tokens), len(set([x for t in tokens for x in range(t.start[0], t.end[0]+1)]))
|
||||
token_count, line_count = len(tokens), len(set([t.start[0] for t in tokens]))
|
||||
token_count, line_count = len(tokens), len(set([x for t in tokens for x in range(t.start[0], t.end[0]+1)]))
|
||||
table.append([relfilepath, line_count, token_count/line_count])
|
||||
return table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user