Created
September 14, 2021 20:48
-
-
Save fictorial/c54e53feb9b547b921bfc30de3851426 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
counts = dict() | |
for root, dirs, files in os.walk(sys.argv[1]): | |
for filename in files: | |
full_path = os.path.join(root, filename) | |
base, ext = os.path.splitext(full_path) | |
if len(ext) == 0: | |
if '.git' in full_path: | |
ext = '<git object>' | |
counts[ext] = counts.setdefault(ext, 0) + 1 | |
for k, v in sorted(counts.items(), key=lambda x:x[1], reverse=True): | |
print(k, v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment