gitdm
gitdm copied to clipboard
Fix minor correctness issues: CSV headers/typos, file closes, ConfigFile croak call, reports counter
Summary
This PR delivers a set of focused, safe fixes discovered while reviewing the codebase:
- CSV header correctness and spelling in
src/csvdump.py:- ChangeSets CSV header now matches the actual column order (Email, then Domain).
- Correct "Affliation" → "Affiliation" in both CSV outputs.
- Explicitly close CSV files after writing to avoid leaking descriptors on long runs.
- Config parsing robustness in
src/ConfigFile.py:- Replace
ConfigFile.croak(...)with module-levelcroak(...)insideReadFileType; prevents a potential NameError when encountering malformed file type lines.
- Replace
- Reporting stability in
src/reports.py:- Fix accumulator variable typo in
ReportByReports(reportedis incremented). This avoids a runtime NameError when generating report credit summaries.
- Fix accumulator variable typo in
Reasoning and impact
- The CSV header fix aligns metadata with emitted data, which prevents downstream misinterpretation when tools ingest the CSVs.
- Typos corrected for clarity when consuming CSVs programmatically.
- Properly closing files is a low-risk stability improvement and avoids running into OS file handle limits in batch runs.
- The
croak(...)fix ensures configuration errors surface correctly instead of raising an unrelated NameError. - The
reportedcounter fix restores intended behavior in reports without changing report content logic.
Scope and risk
- No feature changes or behavior changes beyond correcting header text and the Email/Domain column order to match the existing data order.
- Python version semantics are left intact (code remains Python 2–style; no modernization applied).
- Changes are localized and do not alter public interfaces or control flow.
Validation
- Grepped for remaining typos ("Affliation") — none remain.
- The
ReportByReportspath now uses an existing variable like other report functions. - Config error handling now correctly calls the module-level
croak().