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
cloc --by-file --csv --out data.csv lapack-3.9.0.tar.gz | |
./aggregate_by_folder.py data.csv | grep -Pv "\s0\s*$" | |
blank code comment | |
folder | |
lapack-3.9.0 216 1145 168 | |
lapack-3.9.0/BLAS/SRC 81 16185 25996 | |
lapack-3.9.0/BLAS/TESTING 20 21849 7426 | |
lapack-3.9.0/CBLAS 21 96 14 | |
lapack-3.9.0/CBLAS/cmake 8 20 9 | |
lapack-3.9.0/CBLAS/examples 19 143 8 |
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
#!/usr/bin/env python | |
# A solution to | |
# https://stackoverflow.com/questions/70182311/is-there-a-tool-that-shows-a-distribution-of-lines-of-code-per-file-of-a-folder | |
import sys | |
import os.path | |
import pandas as pd | |
def add_folder(df): | |
""" | |
Return a Pandas dataframe with an additional 'folder' column | |
containing each file's parent directory |