Skip to content

Commit 37f49ed

Browse files
author
Kelly Norton
committed
Initial commit
0 parents  commit 37f49ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+25255
-0
lines changed

.gaan

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pkg
2+
bin
3+
hound.sublime-workspace
4+
data
5+
.vagrant
6+
pub/index.html

LICENSE

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright (c) 2014, Etsy, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Hound
2+
3+
Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox:
4+
[Regular Expression Matching with a Trigram Index](http://swtch.com/~rsc/regexp/regexp4.html). Hound itself is a static
5+
[React](http://facebook.github.io/react/) frontend that talks to a [Go](http://golang.org/) backend. The backend keeps an up-to-date index for each
6+
repository and and answers searches through a minimal API.
7+
8+
## Why Another Code Search Tool?
9+
10+
We've used many similar tools in the past, and most of them are either too slow, too hard to configure, or require too much software to be installed.
11+
Which brings us to...
12+
13+
## Requirements
14+
15+
### Hard Requirements
16+
* Go 1.3+
17+
18+
### Optional, Recommended Software
19+
* Rake (for building the binaries, not strictly required)
20+
* nodejs (for the command line react-tools)
21+
22+
Yup, that's it. You can proxy requests to the Go service through Apache/nginx/etc., but that's not required.
23+
24+
## Hacking on Hound
25+
26+
### Building
27+
28+
```
29+
rake
30+
```
31+
32+
This will build `./bin/houndd` which is the server binary and `./bin/hound` which is the command line client.
33+
34+
### Running in development
35+
36+
```
37+
./bin/houndd
38+
```
39+
40+
This will start up the combined server and indexer. The first time you start the server, it will take a bit of time to initialize your `data` directory with the repository data.
41+
You can access the web frontend at http://localhost:6080/
42+
43+
### Running in production
44+
45+
```
46+
./bin/houndd --prod --addr=address:port
47+
```
48+
49+
The will start up the combined server/indexer and build all static assets in production mode. The default addr is ":6080", and thus the `--addr` flag can be used to have the server listen on a different port.
50+
51+
## Get in Touch
52+
53+
IRC: #codeascraft on freenode
54+
55+
Created at [Etsy](https://www.etsy.com) by:
56+
57+
* [Kelly Norton](https://github.com/kellegous)
58+
* [Jonathan Klein](https://github.com/jklein)

Rakefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
require 'fileutils'
2+
3+
GOPATH=File.open('.gaan').map do |x|
4+
File.absolute_path(File.join(File.dirname(__FILE__), x.strip))
5+
end.join(':')
6+
7+
ENV.update({
8+
'GOPATH' => GOPATH
9+
})
10+
11+
file 'bin/hound' => FileList['src/hound/**/*', 'src/ansi/**/*'] do
12+
host = ENV['HOST'] || 'localhost:6080'
13+
args = ['go', 'build', '-o', 'bin/hound', '-ldflags', "-X main.defaultHost #{host}"] + FileList['src/hound/cmds/hound/*.go']
14+
sh *args
15+
end
16+
17+
file 'bin/houndd' => FileList['src/hound/**/*'] do
18+
sh 'go', 'build', '-o', 'bin/houndd', 'src/hound/cmds/houndd/main.go'
19+
end
20+
21+
task :default => [
22+
'bin/houndd',
23+
'bin/hound',
24+
]
25+
26+
task :clean do
27+
FileUtils::rm_rf('bin')
28+
end
29+
30+
task :test do
31+
pkgs = FileList['src/**/*_test.go'].map do |x|
32+
File.dirname(x[4,x.length])
33+
end.uniq
34+
args = ['go', 'test'].concat(pkgs)
35+
sh *args
36+
end

config-example.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"dbpath" : "data",
3+
"repos" : {
4+
"SomeRepo" : {
5+
"url" : "https://www.github.com/YourOrganization/RepoOne.git"
6+
},
7+
"AnotherRepo" : {
8+
"url" : "https://www.github.com/YourOrganization/RepoTwo.git"
9+
}
10+
}
11+
}

hound.sublime-project

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"follow_symlinks": true,
6+
"path": ".",
7+
"folder_exclude_patterns": ["data"]
8+
}
9+
],
10+
"settings":
11+
{
12+
"tab_size": 2,
13+
"convert_tabspaces_on_save": true,
14+
"translate_tabs_to_spaces": true
15+
}
16+
}

0 commit comments

Comments
 (0)