Working with microservices can be a pain, especially when one change can require multiple places to update. You have to check various repositories for occurrences of the piece of code you need to change. What can you do in that situation?
- Open all your repos in your favourite editor at once
- Use GitHub's search
- Open each and every one of your repos and search manually
- Follow instructions below and start using Hound
What is Hound and how to set it up locally?
Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox: Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API.
And here's how it works!
Here's what you do:
- Go to the folder you want to keep the configs for Hound, for me it was
~/code/hound
- Create a
config.json
file, that points to your local repositories, like this - Run
docker run -d -p 6080:6080 --name hound -v $(pwd):/data -v ~/code:/code etsy/hound
. Please remember that if the folder you keep your repos at is named differently, you have to adjust it in theconfig.json
and in the docker command, specifically-v ~/code:/code
part! - Go to
localhost:6080
& enjoy your quick search!
Bonus: Hound has integrations with Sublime, Vim, Emacs & Visual Studio code so you don't have to leave your favorite editor!
Shout out to https://twitter.com/kmossco and https://twitter.com/balazs_kutil for showing me Hound 🙇
Don't forget to check out my other posts at here.
Love Ruby, new tech, and working remotely? Check out https://leadfeeder.com/jobs and don't forget to mention my name!
Top comments (0)