Skip to content

feat(config): detect and warn unwrapped regex#44285

Draft
RahulGautamSingh wants to merge 1 commit into
renovatebot:mainfrom
RahulGautamSingh:feat/warn-unwrapped-regex-filepatterns
Draft

feat(config): detect and warn unwrapped regex#44285
RahulGautamSingh wants to merge 1 commit into
renovatebot:mainfrom
RahulGautamSingh:feat/warn-unwrapped-regex-filepatterns

Conversation

@RahulGautamSingh

Copy link
Copy Markdown
Collaborator

Changes

managerFilePatterns (and other regex-or-glob options) accept both globs and regexes, where a regex must be wrapped in /.../. When a user writes a pattern that is clearly a regex but forgets the slashes, it is silently treated as a glob and never matches — with no feedback (see discussion #43741).

This adds a config validation warning when an unwrapped matcher contains regex-only tokens (a ^ start anchor, a $ end anchor, or a \d/\w/\s/\b character-class escape) that have no meaning in a glob, e.g.:

npm.managerFilePatterns: the pattern \.html?$ looks like a regex but is not wrapped in /.../, so it is treated as a glob. Wrap it in slashes if you intended a regex.

It's a warning (not an error) because the heuristic can't be certain, and legitimate globs should keep working.

Context

  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

Addresses discussion #43741

AI assistance disclosure

  • Yes — substantive assistance (AI-generated non-trivial portions of code, tests, or documentation). Tool: Claude Code (Claude Opus 4.8).

Documentation (please check one with an [x])

  • No documentation update is required

How I've tested my work (please select one)

  • Newly added/modified unit tests

@github-actions github-actions Bot requested a review from viceice June 29, 2026 05:05
@RahulGautamSingh RahulGautamSingh marked this pull request as draft June 29, 2026 05:17
@RahulGautamSingh RahulGautamSingh removed the request for review from viceice June 29, 2026 05:17
@RahulGautamSingh RahulGautamSingh changed the title feat(config): warn when managerFilePatterns look like unwrapped regex feat(config): detect and warn unwrapped regex Jun 30, 2026
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