ledger: git-tracked file LOC census (5053 files, 211MB, 2.2M lines)
This commit is contained in:
1 parent
c7d13545f8
commit
11f646bee3
2 files changed
+5087
No files matched your search
@@ -0,0 +1,33 @@
|
||||
"""CHECK: troupe-standup git-tracked-file LOC census.
|
||||
|
||||
Re-derives the expected value straight from the live git index
|
||||
(`git ls-files` count) and compares it against the artifact's data-row
|
||||
count. Exit 0 => artifact row count matches reality (correct); nonzero
|
||||
=> mismatch (wrong). Read-only with respect to the repo.
|
||||
"""
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
REPO = "/root/troupe-standup"
|
||||
ARTIFACT = REPO + "/wizard-work/ledger/troupe-gitfile-loc-census.tsv"
|
||||
|
||||
|
||||
def main():
|
||||
r = subprocess.run(
|
||||
["git", "ls-files"], cwd=REPO, check=True, capture_output=True, text=True
|
||||
)
|
||||
expected = len(r.stdout.splitlines())
|
||||
|
||||
with open(ARTIFACT, encoding="utf-8") as fh:
|
||||
lines = fh.read().splitlines()
|
||||
|
||||
assert lines[0] == "track,path,size_bytes,line_count", "bad header: %r" % lines[0]
|
||||
actual = len(lines) - 1
|
||||
if actual != expected:
|
||||
print("MISMATCH artifact_rows=%d git_tracked_files=%d" % (actual, expected))
|
||||
sys.exit(1)
|
||||
print("OK artifact_rows=%d git_tracked_files=%d" % (actual, expected))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user