You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(integ): fix cross-line quote state and quoted global values in the aws-command lint
Second review round (spec + code + test, 3-axis) found two more should-fix
defects and a set of nits. Both defects were reproduced against REAL fixture
content, not synthetic strings.
1. A QUOTED global-option value made the whole invocation vanish.
Blanking replaced a quoted span with SPACES, so `"${REGION}"` stopped being a
token and the option-skip loop consumed `emr` as the value instead:
aws --region "${REGION}" emr list-instance-groups -> missed
aws --region us-east-1 emr list-instance-groups -> found
`"${REGION}"` is the spelling every fixture in this tree uses, so the first
fix was blind to the form it actually meets. Blanking now fills with `_`,
which is inside the token charset and can never start a NAME, so a blanked
span stays exactly one token.
2. Quote state was per-LINE, so the body of a multi-line string parsed as CODE.
This PR itself adds that shape (the `node --input-type=module -e "` blocks in
the EMR fixtures), and a JS comment inside one mentioning the removed verb
became a CI-blocking violation curable only by deleting the comment — exactly
the outcome the blanking exists to prevent, one layer up. Scan state
(`ScanState`) now spans lines, and heredoc bodies are skipped too.
Test-review findings, all addressed:
- The tree walk was UNCOVERED: the floors re-implemented readdirSync instead of
using the lint's walk, so breaking the real filter left every floor green
while the lint scanned nothing. `readFixtureScripts` is now exported and both
sides drive off it.
- Added a CEILING (`total < 3000`) — floors catch a parser that stops seeing
things, only a ceiling catches one that starts seeing things that are not
there, which is what the false positives were.
- The prose fence gained a POSITIVE CONTROL: uncommenting the mention in the
same real fixture must now flag, so the fence proves comment-stripping rather
than general silence.
- The manual real-code fail probe is now also an automated test (splices a
removed verb into real emr-cluster/verify.sh content in memory, asserts
file:line) so it cannot bit-rot between manual runs.
- `globalOption` shape counter asserted exactly 0, to be converted to a floor
the day a fixture uses one.
- Direct `blankQuotedSpans` tests incl. pinned known limitations.
- Corrected a factual claim: TWO fixtures discuss the verb in prose, not three.
- Removed a dead `--flag=value` branch (`=` is a token separator, so it was
unreachable) and completed the value-taking global set — an unrecognised one
was skipped as boolean, putting its VALUE in the service slot.
refresh-aws-cli-removals.ts nits: the event reconciliation no longer greps
comments (a doc mention would have thrown a misleading "parser is stale"),
`--aws-root=<path>` is recognised, and a dangling `aws` symlink no longer throws
past the actionable error.
Floors re-measured after each change: 2635 invocations / 221 fixtures / 68
services / 355 verbs; plain 1008, capture 1023, helper-arg 414, condition 211.
0 commit comments