├── .dockerignore ├── .gitignore ├── .goxc.json ├── .travis.yml ├── CONTRIBUTING.md ├── DCO ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── TODO.md ├── TODOs.no-docker.txt ├── ann ├── ann.pb.go ├── ann.proto ├── annotation.go ├── annotation_test.go ├── doc.go └── gen.go ├── buildstore ├── registry.go └── store.go ├── cli ├── build_data.go ├── cli.go ├── cmdutil.go ├── config_cmd.go ├── coverage_cmd.go ├── coverage_test.go ├── doall_cmd.go ├── gen_data_cmd.go ├── info_cmds.go ├── internal_data_cmds.go ├── lint_cmd.go ├── make_cmd.go ├── makefile_cmd.go ├── misc.go ├── repo_cmds.go ├── repo_config.go ├── repo_opt.go ├── store_cmds.go ├── test_cmd.go ├── testdata │ └── strip-code │ │ ├── expected-source.txt │ │ └── input-source.txt ├── tool_cmd.go ├── toolchain_cmd.go ├── units_cmd.go ├── util.go ├── util_test.go └── version_cmd.go ├── cmd └── srclib │ └── srclib.go ├── config ├── cached.go ├── config.go ├── external.go ├── validate.go └── validate_test.go ├── contrib └── completion │ ├── _srclib │ └── srclib-completion.bash ├── cvg └── coverage.go ├── dep ├── dep.go ├── doc.go ├── resolve.go └── rule.go ├── docs ├── .gitignore ├── README.md ├── build.sh ├── buildsite.py ├── deploy.sh ├── mkdocs.yml ├── sources │ ├── images │ │ ├── srclib_symbol.svg │ │ └── srclib_symbol_white.svg │ ├── install.md │ └── robots.txt ├── test.sh └── theme │ ├── base.html │ ├── community.html │ ├── content.html │ ├── docsnav.html │ ├── home.html │ ├── images │ ├── asterisk.svg │ ├── banner.svg │ ├── dots.svg │ ├── editors │ │ ├── atom.png │ │ ├── sublime.png │ │ └── vim.svg │ ├── favicon.png │ ├── features.svg │ ├── integrations.svg │ ├── languages.svg │ ├── layers.svg │ ├── sourcegraph-emacs.png │ ├── sourcegraphlogo-white.svg │ ├── stack.svg │ └── whiteasterisk.svg │ ├── layout.html │ ├── navbar.html │ ├── newsletter.html │ ├── newsletter2.html │ ├── styles.scss │ └── toc.html ├── env.go ├── flagutil ├── marshal.go └── marshal_test.go ├── gendata ├── common.go ├── simple.go ├── urefs.go └── util.go ├── graph ├── def.go ├── def.pb.go ├── def.proto ├── doc.go ├── doc.pb.go ├── doc.proto ├── errors.go ├── format.go ├── formatter.go ├── formatter_test.go ├── gen.go ├── output.pb.go ├── output.proto ├── proto_test.go ├── ref.go ├── ref.pb.go ├── ref.proto ├── repo.go ├── repo_test.go ├── stats.go └── tree_path_test.go ├── grapher ├── grapher.go ├── registry.go ├── rule.go ├── validate.go └── validate_test.go ├── plan ├── data.go ├── makefile.go ├── makefile_test.go └── util.go ├── scan └── scan.go ├── src-make-build-process.svg ├── store ├── bench_test.go ├── codec.go ├── codec_test.go ├── counter.go ├── def_query_index.go ├── def_query_tree_index.go ├── def_ref_units_index.go ├── def_refs_index.go ├── doc.go ├── filter.go ├── fs_store.go ├── fs_store_mock.go ├── fs_store_test.go ├── fs_test.go ├── index.go ├── index_cache.go ├── index_cache_test.go ├── index_test.go ├── indexed.go ├── indexed_test.go ├── indexed_unit_store_bench_test.go ├── indexes.go ├── indexes_test.go ├── log.go ├── memory.go ├── memory_test.go ├── misc.go ├── misc_test.go ├── multi_repo_store.go ├── multi_repo_store_mock.go ├── multi_repo_store_test.go ├── pb │ ├── gen.go │ ├── helpers.go │ ├── mock │ │ └── srcstore.pb_mock.go │ ├── srcstore.pb.go │ └── srcstore.proto ├── pbio │ ├── io.go │ ├── io_test.go │ └── varint.go ├── phtable │ ├── builder.go │ ├── phtable.go │ ├── phtable_test.go │ ├── slicereader_fast.go │ └── slicereader_safe.go ├── primary_index.go ├── primary_index_test.go ├── ref_file_index.go ├── repo_paths.go ├── repo_paths_test.go ├── repo_store.go ├── repo_store_mock.go ├── repo_store_test.go ├── repo_stores.go ├── repo_stores_test.go ├── store.go ├── test_util.go ├── tree_store.go ├── tree_store_mock.go ├── tree_store_test.go ├── tree_stores.go ├── tree_stores_test.go ├── unit_files_index.go ├── unit_store.go ├── unit_store_mock.go ├── unit_store_test.go ├── unit_stores.go ├── unit_stores_test.go └── units_index.go ├── toolchain ├── bundle.go ├── bundle_test.go ├── choose.go ├── choose_test.go ├── config.go ├── find.go ├── find_test.go ├── tool.go └── toolchain.go ├── toolref.go ├── unit ├── doc.go ├── gen.go ├── source_unit_test.go ├── unit.go ├── unit.pb.go └── unit.proto ├── util ├── ancestordirs.go ├── homedir.go ├── makefile.go ├── makefile_other.go └── makefile_windows.go └── vendor └── vendor.json /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /release/ 2 | /.tmp-selfupdate/ 3 | *.test 4 | vendor/*/ -------------------------------------------------------------------------------- /.goxc.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppName": "srclib", 3 | "ArtifactsDest": "release", 4 | "OutPath": "{{.Dest}}{{.PS}}{{.Version}}{{.PS}}{{.Os}}-{{.Arch}}", 5 | "Tasks": [ 6 | "xc" 7 | ], 8 | "Arch": "amd64", 9 | "Os": "linux darwin", 10 | "ConfigVersion": "0.9", 11 | "BuildSettings": { 12 | "LdFlagsXVars": { 13 | "Version": "sourcegraph.com/sourcegraph/srclib/cli.Version" 14 | }, 15 | "ExtraArgs": ["-a"] 16 | }, 17 | "Env": [ 18 | "CGO_ENABLED=0" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 1.6 3 | sudo: required 4 | 5 | before_install: 6 | - mkdir -p $HOME/gopath/src/sourcegraph.com/sourcegraph 7 | - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/sourcegraph.com/sourcegraph/srclib 8 | - export TRAVIS_BUILD_DIR=$HOME/gopath/src/sourcegraph.com/sourcegraph/srclib 9 | - export PATH=$PATH:$HOME/gopath/bin 10 | - export GOBIN=$HOME/gopath/bin 11 | # Ruby 12 | - curl -L https://get.rvm.io | bash -s stable --ruby 13 | - rvm reload 14 | - rvm install 2.2.2 15 | - rvm use 2.2.2 16 | - gem update bundler 17 | # JavaScript and TypeScript 18 | - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 19 | # Java and Basic 20 | - sudo add-apt-repository -y ppa:openjdk-r/ppa 21 | - sudo add-apt-repository -y ppa:cwchien/gradle 22 | # Python 23 | - sudo add-apt-repository -y ppa:fkrull/deadsnakes 24 | - sudo apt-get update 25 | # Java, Basic, JavaScript, TypeScript, and Python 26 | - sudo apt-get install -y openjdk-8-jdk gradle-2.13 nodejs python3.5 27 | - export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ 28 | # TypeScript 29 | - npm install -g typescript 30 | 31 | install: 32 | - make 33 | 34 | script: 35 | - make test 36 | # TODO: add csharp 37 | - srclib toolchain install go java javascript typescript basic python ruby css 38 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | Sourcegraph projects are [MIT licensed](LICENSE) and accept contributions 4 | via GitHub pull requests. This document outlines some of the conventions on 5 | development workflow, commit message formatting, contact points and other 6 | resources to make it easier to get your contribution accepted. 7 | 8 | # Certificate of Origin 9 | 10 | By contributing to this project you agree to the Developer Certificate of Origin 11 | (DCO). This document was created by the Linux Kernel community and is a simple 12 | statement that you, as a contributor, have the legal right to make the 13 | contribution. See the [DCO](DCO) file for details. 14 | 15 | # Email and Chat 16 | 17 | The project currently uses the 18 | [srclib-dev email list](https://groups.google.com/forum/#!forum/srclib-dev). 19 | 20 | Please avoid emailing maintainers found in the MAINTAINERS file directly. They 21 | are very busy and read the mailing lists. 22 | 23 | ## Getting Started 24 | 25 | - Fork the repository on GitHub 26 | - Read the [README](README.md) for build and test instructions 27 | - Play with the project, submit bugs, submit patches! 28 | 29 | ## Contribution Flow 30 | 31 | This is a rough outline of what a contributor's workflow looks like: 32 | 33 | - Create a topic branch from where you want to base your work (usually master). 34 | - Make commits of logical units. 35 | - Make sure your commit messages are in the proper format (see below). 36 | - Push your changes to a topic branch in your fork of the repository. 37 | - Make sure the tests pass, and add any new tests as appropriate. 38 | - Submit a pull request to the original repository. 39 | 40 | Thanks for your contributions! 41 | 42 | ### Format of the Commit Message 43 | 44 | We follow a rough convention for commit messages that is designed to answer two 45 | questions: what changed and why. The subject line should feature the what and 46 | the body of the commit should describe the why. 47 | 48 | ``` 49 | scripts: add the test-cluster command 50 | 51 | this uses tmux to setup a test cluster that you can easily kill and 52 | start for debugging. 53 | 54 | Fixes #38 55 | ``` 56 | 57 | The format can be described more formally as follows: 58 | 59 | ``` 60 | : 61 | 62 | 63 | 64 |