test(project): split the += rule into its string and array forms - #1359
Merged
Merged
Conversation
One pattern covered two constructs that fail on different versions, so the compat suite could not tell "needs a version guard" from "can never appear at all". Verified against a real GNU bash 3.00.0, with each construct inside `if false; then … fi`: arr+=(x) syntax error at parse time; the file does not run s+=y parses, is skipped, the script continues So the array form kills a file on Bash 3.0 even where nothing reaches it, and a green macOS run says nothing about it, while the string form is safe behind a guard 3.0 never takes. They are two rules now, each carrying that reasoning. The self-check is the point of the split: a fixture of each construct, asserting that neither rule answers for the other. Without it a later edit could quietly widen one back over both and the suite would still be green. Closes #1349 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 #1349
test_src_has_no_append_assignmentmatched two constructs that fail on different Bash versions with one pattern, so the compat suite could not tell "needs a version guard" from "can never appear at all".💡 Changes
x+=y) and an array rule (arr+=(x)), each carrying its own reasoning. Verified against a real GNU bash 3.00.0 with each construct insideif false; then … fi: the array form is a parse error and the file never runs, while the string form parses and is simply skipped..claude/rules/bash-style.mdand the project CLAUDE.md, where the single row read as if both were merely 3.1+ features.No CHANGELOG entry: tests and contributor rules only, matching how the other
test(...)changes here land.https://claude.ai/code/session_01EXYWTGLjf7qM8Ru3GakDRm