fix: distinguish 'no patterns' from 'no files matched' in reloadConfig - #4
Merged
Conversation
Both cases returned entries.length === 0 and showed the same misleading 'No patterns configured' message even when patterns were set but the glob matched nothing. Now checks getRawPatterns() before running the glob so each case gets its own message: - No patterns → 'No patterns configured. Create …' - Patterns set, nothing matched → 'No files matched the configured patterns. Check your glob patterns…' - Files matched but failed to load → 'Patterns matched files but none could be loaded. Check the Output channel…' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Both cases showed the same misleading message
No patterns configured. Create .vscode/codeclimate-visualiser.json…even when the config file was correctly set up but the glob pattern matched no files.Fix
Extract
getRawPatterns()helper and check it before running the glob search, so each failure mode gets a distinct message:No patterns configured. Create .vscode/codeclimate-visualiser.json…No files matched the configured patterns. Check your glob patterns and verify the files exist.Patterns matched files but none could be loaded. Check the Output channel for details.Test plan
reportPatternswith a glob that matches nothing → shows "No files matched" messagereportPatternswith a valid glob → loads correctly🤖 Generated with Claude Code