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

Should a file type filter like --test on the CLI override a previous --notest? #321

Open
hoelzro opened this issue Oct 9, 2020 · 3 comments

Comments

@hoelzro
Copy link

hoelzro commented Oct 9, 2020

For example: Go uses the convention *_test.go for its test files. Most of the time when searching through a codebase I'm not interested in results from test files, so I have the following in my .ackrc:

--type-add=test:match:.*_test[.]go$
--type-add=test:ext:t
--notest

Today, I was interested in some results from test files, so I did ack -wi root --test, but got no results, because --notest from my ackrc was taking effect.

Is overriding --notest with a later --test functionality that ack should have? If not, should --notest and --test issue a mutually exclusive error?

@n1vux
Copy link
Contributor

n1vux commented Oct 9, 2020

i had thought Ack had the convention that any flag on commandline overrides Environment overrides Ackrc,
so i think what you did should have worked and thus would be exposing a bug.

(Might need a test case that fails and a 'blame" bifurcation search?)

@petdance
Copy link
Collaborator

petdance commented Oct 9, 2020

The --test on the command line should have overridden the --notest in the ackrc.

@petdance
Copy link
Collaborator

petdance commented Oct 9, 2020

A --test on the command line will also a --notest preceding it on the command line.

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

No branches or pull requests

3 participants