Skip to content

fix for issue 678#679

Merged
boyter merged 1 commit intomasterfrom
678
Feb 26, 2026
Merged

fix for issue 678#679
boyter merged 1 commit intomasterfrom
678

Conversation

@boyter
Copy link
Owner

@boyter boyter commented Feb 26, 2026

No description provided.

@pr-insights pr-insights bot added L/complexity Low complexity S/size Small change labels Feb 26, 2026
@boyter boyter requested a review from Copilot February 26, 2026 22:54
@boyter boyter merged commit 127ca70 into master Feb 26, 2026
8 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where the --not-match flag (which accepts regular expressions to exclude files and directories) was only matching against filenames and directory names rather than the full file paths. The fix adds an additional filtering layer that applies the regex patterns against the complete file paths after files are discovered by the fileWalker.

Changes:

  • Introduced excludePathRegexes variable to store compiled regex patterns for path-level filtering
  • Added path-based exclusion logic that filters files from potentialFilesQueue by matching regex patterns against full file paths (fi.Location)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 595 to 605
for _, f := range filePaths {
fileInfo, err := os.Lstat(f)
if err != nil {
continue
}

fileJob := newFileJob(f, f, fileInfo)
if fileJob != nil {
fileListQueue <- fileJob
}
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The exclude path regex filtering is not applied to directly specified files. This creates an inconsistency where users can specify a file path directly as an argument and it will be processed even if it matches an exclude pattern. For consistency with the filtering logic applied to discovered files (lines 608-617), consider applying the same exclude path regex check here.

Copilot uses AI. Check for mistakes.
Comment on lines +608 to +617
shouldExclude := false
for _, re := range excludePathRegexes {
if re.MatchString(fi.Location) {
shouldExclude = true
break
}
}
if shouldExclude {
continue
}
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The PR title references "issue 678" but there's no corresponding test case following the project's convention. The codebase has a consistent pattern of adding integration tests named TestIssue{number} in main_test.go for bug fixes (e.g., TestIssue457, TestIssue564). Consider adding a TestIssue678 test case that demonstrates the issue being fixed and validates the solution.

Copilot uses AI. Check for mistakes.
@boyter boyter deleted the 678 branch February 26, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L/complexity Low complexity S/size Small change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants