Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exit code when no matches found #82

Merged
merged 1 commit into from
Feb 25, 2021

Conversation

orlangure
Copy link
Contributor

This commit fixes 2 related issues:

  1. GetContentsMatches of pattern matches never returns nil, but
    sometimes it returns an empty slice. So the condition was changed,
    while maintaining BC (nil slice's length is still 0)
  2. matchedAny should not be set to true for every matched file.
    Instead, it should be set only if there is an actual problem reported
    in this file.

This commit fixes 2 related issues:
1. `GetContentsMatches` of pattern matches never returns `nil`, but
   sometimes it returns an empty slice. So the condition was changed,
   while maintaining BC (nil slice's length is still 0)
2. `matchedAny` should not be set to true for every matched file.
   Instead, it should be set only if there is an actual problem reported
   in this file.
@eth0izzle
Copy link
Owner

Good catch. Merged!

@eth0izzle eth0izzle closed this Feb 25, 2021
@eth0izzle eth0izzle reopened this Feb 25, 2021
@eth0izzle eth0izzle merged commit 50637ca into eth0izzle:master Feb 25, 2021
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.

2 participants