physicsnemo icon indicating copy to clipboard operation
physicsnemo copied to clipboard

fix(ci): parse single-equals interrogate section headers

Open Thabhelo opened this issue 5 months ago • 2 comments

Summary

  • Broaden the interrogate output parser in check_docstring_coverage.py to 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)

Thabhelo avatar Jun 06 '26 04:06 Thabhelo

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.

copy-pr-bot[bot] avatar Jun 06 '26 04:06 copy-pr-bot[bot]

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_output directly.

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

greptile-apps avatar Jun 06 '26 04:06 greptile-apps

@coreyjadams @ktangsali gentle ping when you have a moment. Greptile feedback is addressed (conftest added in eabdf15). Small CI-only fix, unit tested. Thanks!

Thabhelo avatar Jun 22 '26 14:06 Thabhelo