-
-
Notifications
You must be signed in to change notification settings - Fork 990
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
Multiple --not-match-f override each other, instead of being applied additively #724
Comments
None of the
I'm sure I'm overlooking situations where multiple copies of |
Hi @AlDanial, thanks for the reply! Given your info, I'd categorize this as an enhancement request issue, not a bug. You're correct in stating that all possible matches can be thought of and specified in a single regex, thanks for pointing that out. I would say though that for users who are less regex experienced, or when I'm trying to explain to another party how to use cloc over email/phone call, it is tremendously simpler to use multiple parameters to build a list of filters. From what I've seen from working with other tech professionals who use other command line tools, this is a commonly expected pattern (additive list of filters) that works in other tools (Tokei for instance). I totally understand if implementing this behavior change is a big ask why you might want to decline this enhancement request, but if it is a smaller ask, please consider it! Thank you. |
It's not a big ask and I'm familiar with additive options (cloc's |
Sounds good @AlDanial |
this is a partial implementation, still need --match-f, --match-d
I've begun work on this; try the latest commit to kick the tires on additive |
Describe the bug
When running the following command (and any similar command with more than one --not-match-f stated) the default expectation is that all files who have a basename ending with _test.go and _proto.go will not be included for counting consideration by cloc. The actual behavior of cloc seems to be that a single (I believe the last stated) not-match-f will be honored as a filter instead of all statements of --not-match-f
cloc; OS; OS version
To Reproduce
See comment on this youtube video for repro:
https://www.youtube.com/watch?v=eRLTkDMsCqs
Expected result
All not-match-f filters are applied within cloc for filtering consideration instead of only one.
Thanks for considering this Al, perhaps we can change cloc's default behavior to be additive filter with this command line option instead of single filter respected? Apparently this unexpected behavior has been around a while!
BTW does this situation also apply to match-f, match-d, and not-match-d command line options as well?
The text was updated successfully, but these errors were encountered: