fix(parsing): adding check for acceptance test heading#226
Merged
Conversation
ae775bf to
2d8764a
Compare
…ests script Acceptance tests are treated as conformance tests, so a conformance tests script is required to run them. Emit a warning (covering the top module and all required modules) on both the render and --dry-run paths when acceptance tests are present but no conformance tests script is configured.
2d8764a to
4682d44
Compare
Previously the module was constructed in both the dry-run branch and inside render(), and render() re-parsed the file again just to compute the render range. Parse the plain file once in main() and pass the PlainModule into render(), removing the duplicate construction and the redundant re-parse.
VitjanZ
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves handling of
acceptance testsin.plainfiles:definitions,implementation reqs,test reqs), raising aPlainSyntaxErrorwith a clear message and line number.--dry-run, and covers the top module and all required modules in both cases.Changes
plain_file.py:PlainSyntaxErrorwhen anacceptance testsheading appears at the top level instead of nested under a functional spec._find_acceptance_test_heading()to recursively search a section's token tree for anacceptance testsheading.definitions,implementation reqs,test reqs) and reject any nestedacceptance testsheading.plain_spec.py: addhas_acceptance_tests()helper to detect whether a plain source defines acceptance tests.plain2code.py:warn_acceptance_tests_without_conformance_script()(core helper, takes module names) andwarn_if_acceptance_tests_without_conformance_script()(module-based wrapper covering the top module and all required modules).--dry-run, build a realPlainModule(recursively parses required modules, no API calls) and call the module-based wrapper so the warning covers required modules there too.Tests
tests/test_plainfileparser.py: top-level rejection, nested-under-definitions/implementation reqs/test reqsrejection, and a regression guard that properly nested acceptance tests under a functional spec are allowed.tests/test_plainspec.py:has_acceptance_tests()true/false/empty/no-functional-requirements cases.tests/test_plain2code.py: warning emitted with no conformance script, suppressed when configured, suppressed without acceptance tests, emitted when acceptance tests live only in a required module, core-helper cases, and an integration test building a realPlainModule(main module without acceptance tests requiring a module that has them) asserting the required module is named in the warning.tests/data/acceptance_tests_warning/: fixtures for the integration test.