Greptile was right: the guard was added to check_endpoint_coverage.py, and that
script is not run by any workflow - so it would never have executed. A check that
never runs is decoration.
It cannot simply be added to CI as-is: check_endpoint_coverage.py currently exits 1
because docs/my-website/sidebars.js no longer exists at the path it expects. That
failure is unrelated to this change, and wiring the script up as-is would turn CI
red for a reason this PR did not cause.
So the guard moves into its own small script and gets its own CI step:
- tests/code_coverage_tests/check_json_duplicate_keys.py (new, standalone)
- one step in .github/workflows/test-code-quality.yml, next to check_licenses
- check_endpoint_coverage.py reverted to exactly its upstream contents
Verified it fails when it should: re-inserting the duplicate charity_engine entry
makes the new step exit 1 and name the key; removing it again exits 0.
The script also exits 1 if FILES_TO_CHECK is empty or a listed path is gone -
scanning zero files must not look like success.