Skip to content

Skip @type inside docblock description in blink TypeToVarTag - #102

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-typetovar-skip-description
Sep 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-typetovar-skip-description

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Ports TypeToVarTagFixer #81 to blink. blink's TypeToVarTag rewrote every @type to @var, including occurrences inside a docblock description (e.g. the sentence "Matches only @type at the start of a line"). ECS fixed this in #81 to only match @type at the start of a doc line.

Change

  • typeTagRe: @type\b -> (?m)^(\s*(?:/\*{1,2}|\*)?\s*)@type\b, replacement ${1}@var, mirroring the PHP regex.
  • Unit test for the description-skip case.

Result

This was the last --blink divergence from ECS on this repository:

  • standalone parity vs ECS on rector-src: 0/1699
  • --blink parity on this repo: 0 (was 1)

build, vet, gofmt -s, modernize, golangci-lint, go test all pass.

Port TypeToVarTagFixer #81 to blink: only rewrite @type to @var at the start of a
doc line (after an optional /**, /* or *), never inside a description. This was the
last --blink divergence from ECS on this repository.
@TomasVotruba
TomasVotruba merged commit 6a86fe7 into main Sep 30, 2026
17 checks passed
@TomasVotruba
TomasVotruba deleted the blink-typetovar-skip-description branch September 30, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant