test(project): catch every parameter spelling of ${var,,} - #1360
Merged
Conversation
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
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.
🤔 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
$@/$*. Confirmed the construct is genuinely unsupported below 4.0:${1,,}is abad substitutionon both bash 3.00.0 and 3.2.57, and printsabcon bash 5.${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.test_src_has_no_parameter_transformationshas 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