Skip to content

🐛 fix(parser): accept whitespace around = in {{ name = default }} blanks - #335

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-334
Oct 25, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-334

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #334

VAR_PATTERN accepted padding around the name but not around =, so {{ name = value }} was not recognised as a blank and silently rendered empty. Optional whitespace is now accepted on both sides of =; DOTTED_PATTERN was already tolerant. Comment, README and tests updated; dist regenerated.

Behaviour change: {{file= main.go}} now defaults to main.go (leading space dropped), consistent with trailing padding not being part of a default.

Validation: not run locally; CI is the verdict.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 25, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 25, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the change against the tree at 6152f3a and it looks correct to me.

  • src/parser.ts:35 — adding \s*=\s* is the minimal fix; the lazy ([^}]*?) followed by \s*\}\} still strips trailing padding, so {{ a = b c }} keeps the interior space (covered by the new test).
  • src/parser.ts:41 — DOTTED_PATTERN already has \s* before the optional =, so {{ repo.owner = x }} is still rejected rather than silently rendered.
  • src/commands.ts:122-131 — the show highlighter re-uses VAR_PATTERN and colours the raw match, so padded-= tags now get highlighted as written with no further change needed.
  • Rebuilt locally: dist/ is in sync (no drift after npm run build), 468/468 tests pass.
  • The PR body's one behaviour change ({{file= main.go}} → default main.go) is reflected in changelog.d/fixed-334.md and README.

Resolves the three repro cases in #334 (unknown --file flag, empty render, green --status).

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the parser and its callers at head 6152f3a; this looks correct to me.

  • src/parser.ts:35 — (?:\s*=\s*([^}]*?))? keeps the lazy default group, so {{ a = b c }} → b c and {{name= }} → "" as before; {{ name }} without a default is unaffected since the whole = group is optional.
  • src/parser.ts:93 — the expand normalisation and src/commands.ts:124 — show highlighting both rewrite via the same VAR_PATTERN and use the full raw match, so padded-= tags are now filled/highlighted instead of being handed to Mustache as a variable literally named name = value (the silent-empty path #334 reproduces).
  • DOTTED_PATTERN (src/parser.ts:41) already tolerates \s* before =, so dotted-name rejection is unchanged.

Verified locally: npm test 468/468 passing on the PR head; npm run build reproduces the committed dist/ byte-for-byte (dist-sync gate clean). The one behaviour change — {{file= main.go}} now defaulting to main.go rather than main.go — is stated in the body and changelog.d/fixed-334.md, and matches the existing trailing-padding rule.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 339192e into main Oct 25, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-334 branch October 25, 2026 08:58
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#3356152f3a` sha256:e03f32a9f05fa12264688fae8a001a95cff0af28cbc37ac1932f6467be329241 — download from the dashboard or `hivectl review evidence #335`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] padded default ({{ name = value }}) is invisible to promptargs: silently rendered empty, --flag rejected as unknown, --status reports ✅

0 participants