Skip to content

Match typed-path lint URL detection to runtime roots - #65490

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/typedpaths-url-prefixes
Nov 17, 2026
Merged

Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/typedpaths-url-prefixes

Conversation

@jakebailey

Copy link
Copy Markdown
Member

The lint rule was wrong here.

Drive-like prefixes are URL roots unless they satisfy the runtime's DOS
root rules. Treating every second-character colon as a drive bypasses URL
query and fragment validation for strings that runtime rejects.

Require a letter and a rooted drive suffix, reuse the URL classifier for
suffix parsing, and cover rejected queries alongside accepted drive and
URL edge cases in the analyzer fixtures.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the typed-path URL and Windows drive-root detection changes.

No open issues 🎉

What changed in this PR

Aligns typed-path lint URL detection with runtime path-root handling, distinguishing Windows drive roots from URL-like paths.

Changes:

  • Restricts drive-root detection to alphabetic drive letters followed by a colon and either a separator or the end of the string.
  • Reuses URL detection when extracting URL path components.
  • Adds accepted and rejected constructor cases and updates expected diagnostics.
File Description
tools/​customlint/​typedpaths.go Corrects drive-root detection and shares URL classification logic.
tools/​customlint/​testdata/​typedpaths/​typedpaths.go.golden Updates expected diagnostics for the new regression cases.
tools/​customlint/​testdata/​typedpaths/​typedpaths.go Adds coverage for drive roots, URL-like paths, and query or fragment characters.

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 17, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 17, 2026
Merged via the queue into microsoft:main with commit 53e665f Nov 17, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the compiler-fixes/typedpaths-url-prefixes branch November 17, 2026 21:52
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants