Review a report before it is published
Task
The domain 4 capstone. Build an automatic pre-publication checklist for the one-page report, prove it catches planted errors, and write the sign-off that says who checked the report and who owns its numbers.
Steps
- Build the report from the static-report lab again, as
lab/review/report.html. - Write
lab/review/checklist.pytaking a report's path and printing one line per check,PASS NAMEorFAIL NAME, exiting 1 if any fail. The checks areheadline-orders(the orders figure equals the valid orders recalculated from the data),headline-revenue(net_revenue equals the recalculation to the cent),regions-sum(the region rows sum to net_revenue within 0.05),as-of-presentandfour-regions. - Copy the report to
lab/review/broken.htmland plant two faults: change the orders figure to 2000, and delete the as-of line. - Write
lab/review/signoff.mdwith the headings## Checked,## Reviewer,## Ownerand## Corrections.
Verify
These checks run in a POSIX shell with Python 3: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. On Windows, python3 is often a Microsoft Store placeholder that prints “Python was not found”; run alias python3=py in Git Bash first.
python3 lab/review/checklist.py lab/review/report.html; echo "exit $?"
python3 lab/review/checklist.py lab/review/broken.html | grep -c '^FAIL'
grep -cE '^## (Checked|Reviewer|Owner|Corrections)' lab/review/signoff.md
Five PASS lines and exit 0 for the real report, 2 FAIL lines for the broken copy, and all 4 sign-off headings. The planted 2000 is the raw row count, not the valid orders: the exact mistake a report makes when a filter is dropped, and one that no amount of looking at the page would catch.
This is an independent study companion for CompTIA Data+ DA0-002 and is not produced by or endorsed by CompTIA.