tools/raw_recorder/RawRecord.java + shadow/GameRecorder.java the observer
that writes the .battle.gz corpora in data/ (gitignored, regenerable)
tools/raw_recorder/query.py, sample_outline.md query helpers
and the shape of a capture
tr_bots/_salvage/ the port audit:
portaudit/{methods,static}.py, shim/, and the tr_wrappers/*.json + *.sh
for 29 rescued legacy bots, with legacy_bots/MANIFEST.sha256
21 lines
787 B
Python
21 lines
787 B
Python
import re, os
|
|
root="/tmp/portaudit/src"
|
|
pat=re.compile(r'^\s*(public|private|protected)?\s*static\s+(?!final)([\w\[\]<>,\.]+)\s+([A-Za-z_]\w*)\b.*;\s*$')
|
|
counts={}
|
|
allrows=[]
|
|
for dp,_,fs in os.walk(root):
|
|
for f in fs:
|
|
if not f.endswith(".java"): continue
|
|
p=os.path.join(dp,f)
|
|
# note: static block 'static {' not matched
|
|
for i,l in enumerate(open(p),1):
|
|
s=l.strip()
|
|
if s.startswith("//") or s.startswith("*"): continue
|
|
m=pat.match(l)
|
|
if m and "(" not in l.split(";")[0]:
|
|
typ=m.group(2); name=m.group(3)
|
|
allrows.append((p.replace(root+"/",""),i,typ,name))
|
|
print("TOTAL static non-final fields:", len(allrows))
|
|
for r in allrows:
|
|
print(f" {r[0]}:{r[1]} {r[2]} {r[3]}")
|