Skip to content

docs(workflows): init step docstring lists the 'py' script type#3655

Merged
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:docs/init-step-script-py-docstring
Jul 22, 2026
Merged

docs(workflows): init step docstring lists the 'py' script type#3655
mnriem merged 1 commit into
github:mainfrom
jawwad-ali:docs/init-step-script-py-docstring

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

What

The InitStep class docstring described the script field as "Script type, sh or ps." — 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 from VALID_SCRIPT_TYPES
  • so script: py passes validation and produces a valid --script py argv

The 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 every VALID_SCRIPT_TYPES entry appears in InitStep.__doc__ (fails before the fix, since py was absent). ruff clean.


AI-assisted: authored with Claude Code. Verified against VALID_SCRIPT_TYPES and the step's own validate().

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates InitStep documentation to match its supported script types.

Changes:

  • Documents py alongside sh and ps.
  • 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

@mnriem
mnriem merged commit 3356161 into github:main Jul 22, 2026
14 checks passed
@mnriem

mnriem commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants