Skip to content

xtask-spellcheck fails to extract the typos version after a valid workflow reindent #16732

@meng-xu-cs

Description

@meng-xu-cs

Problem

crates/xtask-spellcheck/src/main.rs hardcodes six leading spaces in TYPOS_STEP_PREFIX and then searches for the typos step using contains(...) before calling strip_prefix(...).

That makes the extractor depend on the uses: line starting with exactly six leading spaces, like:

"      uses: crate-ci/typos@v"

A valid reindent of .github/workflows/main.yml can move the line to a different indentation width (for example, 8 spaces instead of 6). In that case the line still contains the hardcoded substring, but it no longer starts with it, so extraction fails with:

Could not find typos version in workflow

Steps

  1. Reindent the entire jobs: subtree in .github/workflows/main.yml by two spaces. The workflow remains valid YAML, but the spellcheck action line changes from:
      uses: crate-ci/[email protected]

to:

        uses: crate-ci/[email protected]
  1. Run the xtask, for example:
cargo run -p xtask-spellcheck
  1. Observe that version extraction fails before typos runs.

Possible Solution(s)

No response

Notes

This issue is not end-user-facing, but it makes xtask-spellcheck fragile to harmless workflow formatting changes and can block contributors or CI maintainers from running the spellcheck xtask locally after reformatting or refactoring the workflow file.

Version


Metadata

Metadata

Assignees

Labels

A-infrastructureArea: infrastructure around the cargo repo, ci, releases, etc.C-bugCategory: bugS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions