CONTRIBUTING.md 2.3 KB
Newer Older
1 2 3
Contributing to hub
===================

M
Mike McQuaid 已提交
4 5
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).

6
This project adheres to a [Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
7

8
[code-of-conduct]: ./CODE_OF_CONDUCT.md
9

10 11
You will need:

12
1. Go 1.11+
M
Mislav Marohnić 已提交
13
1. Ruby 1.9+ with Bundler
14 15 16
2. git 1.8+
3. tmux & zsh (optional) - for running shell completion tests

17 18 19
If setting up either Go or Ruby for development proves to be a pain, you can
run the test suite in a prepared Docker container via `script/docker`.

20 21 22
## What makes a good hub feature

hub is a tool that wraps git to provide useful integration with GitHub. A new
23
feature is a good idea for hub if it improves some workflow for a GitHub user.
24 25 26 27 28 29 30

* A feature that encapsulates a git workflow *not specific* to GitHub is **not**
  a good fit for hub, since something like that is best implemented as an
  external script.
* If you're proposing to add a new custom command such as `hub foo`, please
  research if there's a possibility that such a custom command could conflict
  with other commands from popular 3rd party git projects.
C
CyberFlame 已提交
31
* If your contribution fixes a security vulnerability, please refer to the [SECURITY.md](./.github/SECURITY.md) security policy file
32 33 34

## How to install dependencies and run tests

35
1. [Clone the project](./README.md#source)
J
Jingwen Owen Ou 已提交
36
2. Verify that existing tests pass:
M
Mislav Marohnić 已提交
37
    `make test-all`
J
Jingwen Owen Ou 已提交
38
3. Create a topic branch:
39
    `git checkout -b feature`
J
Jingwen Owen Ou 已提交
40
4. **Make your changes.**
41
   (It helps a lot if you write tests first.)
M
Mislav Marohnić 已提交
42
5. Verify that the tests still pass.
43 44
6. Fork the project on GitHub:
    `make && bin/hub fork --remote-name=origin`
J
Jingwen Owen Ou 已提交
45
7. Push to your fork:
46
    `git push -u origin HEAD`
J
Jingwen Owen Ou 已提交
47
8. Open a pull request describing your changes:
M
Mislav Marohnić 已提交
48
    `bin/hub pull-request`
49

T
Tariq Ibrahim 已提交
50 51
Vendored Go dependencies are managed with [`go mod`](https://github.com/golang/go/wiki/Modules).
Check `go help mod` for information on how to add or update a vendored
52 53
dependency.

54 55
## How to write tests

56 57
Go unit tests are in `*_test.go` files and are runnable with `make test`. These
run really fast (under 10s).
58

59 60
However, most hub functionality is exercised through integration-style tests
written in Cucumber. See [Features](./features) for more info.