Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

feature request: -single-file param #56

Open
quasilyte opened this issue Jun 6, 2020 · 0 comments
Open

feature request: -single-file param #56

quasilyte opened this issue Jun 6, 2020 · 0 comments

Comments

@quasilyte
Copy link
Contributor

Suppose you're about to do some refactoring inside some specific file.
You want to do a -x pattern with -s replacement to get the job done.
The problem is that we can't reliably run a gogrep over a single file since
it looks like it does a typechecking even if no type-related filters are involved (I may be wrong here).

We can get a cheap fix of this problem by adding a way of telling "I'm giving you a package as a target, but I'm only interested in one specific file". It could either be a bool param that makes gogrep infer the file package from the specified filename, load the package and then print results only for that file. A simpler approach is to make that param a string that tells which filename to include into the output, all other matches should be discarded.

If we generalize, it looks like I need an additional file filter, which may not necessarily be limited to 1 file, but I can't come up with a good use case for that at the moment.

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

No branches or pull requests

1 participant