fix(ci): parse single-equals interrogate section headers
Summary
- Broaden the interrogate output parser in
check_docstring_coverage.pyto accept section headers with any number of equals signs (including the single-=format used by interrogate 1.7). - Add unit tests for single- and multi-equals header parsing.
Related context: #1703 added docstrings on a few crash example symbols because the hook falsely reported baseline-grandfathered items as new when editing example files. This PR fixes that root cause.
Test plan
- [x]
pytest test/ci_tests/test_check_docstring_coverage.py - [x]
python test/ci_tests/check_docstring_coverage.py examples/structural_mechanics/crash/datapipe.py examples/structural_mechanics/crash/train.py(passes with baseline-only gaps, no false positives)
This pull request requires additional validation before any workflows can run on NVIDIA's runners.
Pull request vetters can view their responsibilities here.
Contributors can view more details about this message here.
Greptile Summary
This PR fixes a false-positive in the docstring-coverage pre-commit hook by broadening the interrogate output parser to accept section headers that use any number of equals signs, including the single-= format introduced in interrogate 1.7. Two unit tests are added to cover both the single-equals and multi-equals header variants.
check_docstring_coverage.py: Regex changed from={4,}to=+, letting the parser handle interrogate 1.7's= Coverage for … =header style without touching any other logic.test_check_docstring_coverage.py: New test module with two parameterized scenarios (single-equals, multi-equals) that exercise_parse_interrogate_outputdirectly.
Important Files Changed
| Filename | Overview |
|---|---|
| test/ci_tests/check_docstring_coverage.py | Regex broadened from ={4,} to =+ so single-equals interrogate 1.7 section headers are parsed correctly alongside the existing multi-equals format. |
| test/ci_tests/test_check_docstring_coverage.py | New test file covering both single-equals and multi-equals header variants; import works via pytest's rootdir sys.path injection but would benefit from a conftest.py for resilience. |
Reviews (1): Last reviewed commit: "fix(ci): parse single-equals interrogate..." | Re-trigger Greptile
@coreyjadams @ktangsali gentle ping when you have a moment. Greptile feedback is addressed (conftest added in eabdf15). Small CI-only fix, unit tested. Thanks!