ci: document and gate product exit codes in README tables - #150
Merged
Merged
Conversation
The checker in the next commit covers templates/. Product codes lived in prose only, so a missing-table file would fail the gate. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
AST collects return N and literal sys.exit(N) on examples, templates, and showcase. sys.exit(main()) and the FATAL except wrapper are not product codes. Blocking from day one; no skip list. Closes #138. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
50a26c7):headless-batch-script-templateREADME now has a CONTRIBUTING-shaped exit table for0, argparse/no mesh2, modifier3, glTF4. Script unchanged.extension-addon-templatehas nosys.exitand needs nothing.ai-asset-pipeline-templatealready had a table.b1c1268):tests/check_exit_code_readme.py, wired blocking invalidate.yml. AST only. No exemption list.Detection: integer
return Nplus literalsys.exit(N)inexamples/,templates/,showcase/.sys.exit(main())/sys.exit(exit_code)afterexit_code = main()are harness pass-through.sys.exit(1)inexceptis FATAL. README check is entry-point files only (if __name__ == "__main__"). Helpers such asgallery_framing.pyare still scanned for unanalyzablesys.exit.No non-literal product exits in the tree. No skip file.
Gate-failure proof (verbatim)
===== 1-undocumented-return exit=1 =====
ERROR: examples/bmesh-gear/bmesh_gear.py:218: return/exit 99 is not in the examples/bmesh-gear/README.md exit table
===== 2-unanalyzable-exit exit=1 =====
ERROR: examples/bmesh-gear/bmesh_gear.py:223: unanalyzable exit code: sys.exit(undocumented)
===== 3-fatal-guard-clean exit=0 =====
exit-code README checks passed.
===== 4-kit-exit-10-undocumented exit=1 =====
ERROR: examples/modular-kit-snap/modular_kit_snap.py:629: return/exit 10 is not in the examples/modular-kit-snap/README.md exit table
===== 5-clean-tree exit=0 =====
exit-code README checks passed.
Canaries were applied, observed, and deleted. Working tree after #5 matches HEAD. Canary 3 is the same checker run against the tree that still has the normal
__main__sys.exit(1)FATAL wrappers (e.g.bmesh-gear).Test plan
No example behavior change —
needs-5.1not applied.Live run: canaries above. Inspection: template
script.pyuntouched;validate.ymlstep next tocheck_import_export_rules.py.