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

Request for a .hound-exclude file in repo. #445

Open
dwright opened this issue Dec 20, 2022 · 4 comments
Open

Request for a .hound-exclude file in repo. #445

dwright opened this issue Dec 20, 2022 · 4 comments

Comments

@dwright
Copy link

dwright commented Dec 20, 2022

As a repo maintainer, I would really like a way to be able to tell hound not to index certain files inside my repo. And I would like to be able to do so without requiring my git admins to update their global config file.

My suggestion is to support a .hound-exclude file in the top level of the repo that hound would read an honor when indexing. Sort of the equivalent of a robots.txt file for web crawlers. I'd like to be able to specify filenames or directories to exclude.

@salemhilal
Copy link
Contributor

Can you tell us more about your use case? Currently, we have:

  • .gitignore (of course) for keeping things out of the repo
  • excludes and ignores for keeping things out of queries

I'm not sure about the use case for a repo owner preventing others from searching the contents of the files in the repo, but I'd be open to hear more. Usually, it's up to the person doing the searching to prune things they don't want to see from their query.

@dwright
Copy link
Author

dwright commented Dec 20, 2022

My particular use case is for an internal company repo.

There are cases where we have test data, or even some production data that is kept in a repo somewhere. And it's usually not anything that we ever want to search for. But often, it does end up getting caught in our queries and thus increases the noise to signal ratio. I don't want to exclude the whole repo because there is important code in there. But I do want to be able to exclude the test data.

@salemhilal
Copy link
Contributor

Hmm. Having something excluded from Hound's index that isn't excluded from the repo sounds a bit tricky (someone put that data there, so presumably they'd eventually want to search for it), but I see your problem. I'm sure we'd accept a PR for that.

Since we typically filter searches using the exclusion filters in the UI, I wonder if having those fields' contents saved in localstorage would be a good enough solution? That way, you'd filter your results once in the UI and then retain those filters in subsequent searches. That seems like a general improvement to the UI anyways, and it could solve your problem as well.

@qyk1995
Copy link

qyk1995 commented Feb 15, 2023

@salemhilal Filtering in the UI is not easy to control permissions, so it is recommended to configure filtering files or directories in the configuration file. What should we do?

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