Skip to content

test(project): catch every parameter spelling of ${var,,} - #1360

Merged
Chemaclass merged 1 commit into
mainfrom
fix/1350-case-conversion-rule-positional
Sep 9, 2026
Merged

test(project): catch every parameter spelling of ${var,,}#1360
Chemaclass merged 1 commit into
mainfrom
fix/1350-case-conversion-rule-positional

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1350

The case-conversion rule built its pattern around a name class of [A-Za-z_][A-Za-z0-9_]*, so it caught ${var,,} and walked past ${1,,} and ${@,,} — the same Bash 4.0 construct, failing the same way.

💡 Changes

  • Widen the class to positional parameters and $@/$*. Confirmed the construct is genuinely unsupported below 4.0: ${1,,} is a bad substitution on both bash 3.00.0 and 3.2.57, and prints abc on bash 5.
  • Pin every spelling in a test, plus a negative case (${var:-,}, ${#var}, ${arr[*]}), so the rule cannot narrow back to whichever form is written most often. Against the old pattern that test catches 1 of 4 spellings.
  • Noticed while here, not changed: test_src_has_no_parameter_transformations has the same shape, so ${1@Q} slips past it too. Worth its own issue.

No CHANGELOG entry: tests only.

https://claude.ai/code/session_01EXYWTGLjf7qM8Ru3GakDRm

The rule built its pattern around a name class of
`[A-Za-z_][A-Za-z0-9_]*`, so it saw `${var,,}` and walked past `${1,,}`
and `${@,,}`. All three are the same Bash 4.0 construct:

  bash 3.00.0  ${1,,}: bad substitution
  bash 3.2.57  ${1,,}: bad substitution
  bash 5       abc

They fail at runtime, not at parse time, so an uncaught one ships and
breaks only when its line executes -- the exact gap this file exists to
close.

Widen the class to positional parameters and `$@`/`$*`, and pin every
spelling in a test, since the rule narrowing back to the form that
happens to be written most often is how it got here.

Closes #1350

Claude-Session: https://claude.ai/code/session_01EXYWTGLjf7qM8Ru3GakDRm
@Chemaclass Chemaclass added the bug Something isn't working label Sep 9, 2026
@Chemaclass Chemaclass self-assigned this Sep 9, 2026
@Chemaclass
Chemaclass merged commit 9f297a4 into main Sep 9, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the fix/1350-case-conversion-rule-positional branch September 9, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant