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

Have a --noignore-file option #373

Open
blmatthews opened this issue Aug 1, 2023 · 1 comment
Open

Have a --noignore-file option #373

blmatthews opened this issue Aug 1, 2023 · 1 comment
Labels

Comments

@blmatthews
Copy link

There are some builtin --ignore-files that I'd like to override (specifically not searching minified files), but there doesn't seem to be an easy way to do that (i.e. where I can just continue typing ack pattern). I'd like to suggest a --noignore-file option. I can see a couple of ways it could work:

  1. If a --noignore-file option is given and there's a --ignore-file option in effect with the same right-hand side as the --noignore-file, drop the --ignore-file (and if there isn't a matching --ignore-file, maybe give a warning).
  2. Collect the --noignore-files and if a file matches a --ignore-file, try it against the --noignore-files, and if it matches one of those, don't ignore it.

The first is probably easier to implement, but the second would also allow ignoring a large class of files but then overriding that for a subset of the class.

@n1vux
Copy link
Contributor

n1vux commented Aug 1, 2023

since the email thread leading to this ticket has demonstrated there is a usecase / job-rôle where searching minified JavaScript (or equivalently minified CSS) would be the normal preference, not just a rare exception, this is a good thing to provide under our "every --thing has a --no[-]?thing" meta-rule, as --ignore-ack-defaults is a rather large mallet that removes too much.

Especially if we do something for #325 to provide characters of context around a match in those long lines !
e.g., syntactic sugar for long-lines workaround ack -o '.{0,20}string.{0,20}' might be used as
ack --noignore-file --type=js --CC20 string
(And this request supports that ticket and vice-versa.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants