docs(workflows): init step docstring lists the 'py' script type#3655
Merged
mnriem merged 1 commit intoJul 22, 2026
Merged
Conversation
The InitStep `script` field docstring claimed only 'sh' or 'ps', but the
step's own VALID_SCRIPT_TYPES = tuple(SCRIPT_TYPE_CHOICES.keys()) is
('sh', 'ps', 'py') and validate() accepts all three (its error message is
built from VALID_SCRIPT_TYPES). Update the docstring to list 'py' too, so
it no longer contradicts the same class's validate() authority.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates InitStep documentation to match its supported script types.
Changes:
- Documents
pyalongsideshandps. - Adds a regression test covering all valid script types.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/workflows/steps/init/__init__.py |
Corrects the script field documentation. |
tests/test_workflows.py |
Verifies every valid script type is documented. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
Collaborator
|
Thank you! |
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.
What
The
InitStepclass docstring described thescriptfield as "Script type,shorps." — but the init workflow step accepts a third value,py:VALID_SCRIPT_TYPES = tuple(SCRIPT_TYPE_CHOICES.keys())resolves to('sh', 'ps', 'py')validate()accepts any of the three and builds its error message dynamically fromVALID_SCRIPT_TYPESscript: pypasses validation and produces a valid--script pyargvThe docstring was the only place hard-coding the stale two-value pair, contradicting the same class's
validate()authority.Fix
Docstring-only:
Script type, ``sh`` or ``ps``.→Script type, ``sh``, ``ps``, or ``py``.Tests
tests/test_workflows.py::TestInitStep::test_docstring_lists_every_valid_script_type— asserts everyVALID_SCRIPT_TYPESentry appears inInitStep.__doc__(fails before the fix, sincepywas absent).ruffclean.AI-assisted: authored with Claude Code. Verified against
VALID_SCRIPT_TYPESand the step's ownvalidate().