Skip to content

Latest commit

 

History

History
87 lines (59 loc) · 2.47 KB

CONTRIBUTING.md

File metadata and controls

87 lines (59 loc) · 2.47 KB

Development

Repository for git-brws is hosted at GitHub.

Run tests

To watch file changes and run linter/tests automatically:

cargo install cargo-watch
cargo watch -x clippy -x test

Some tests require GitHub API access token. To run full tests:

export GITHUB_TOKEN=xxxxxxxxxxx
cargo test

Note: Without GITHUB_TOKEN environment variable, cargo test runs test cases partially though it says every test case was run. This is because cargo test does not provide a way to skip test cases dynamically in source.

cargo test and cargo clippy are automatically run on pushing to remote by cargo-husky. But some tests fail when the remote tracking branch does not exist. When you create a new branch, please use --no-verify. Please do not use --no-verify otherwise.

git checkout -b new-branch
git push -u origin new-branch --no-verify

Note: When $GITHUB_TOKEN environment variable is set, some tests call GET /search/* GitHub APIs. They have special rate limit 30/min. Running all unit tests more than twice within 1 minute would hit the rate limit.

Prepare manpage

To update manpage file git-brws.1 and docs/index.html, please edit git-brws.1.ronn and generate git-brws.1 automatically with docs/gen.sh script. ronn is necessary as a dependency.

gem install ronn
./docs/gen.sh

Update Homebrew formula

To update Homebrew formula file, please use HomebrewFormula/update.sh.

For example, when updating to 0.11.6:

./HomebrewFormula/update.sh v0.11.6

Update changelog

To update changelog, please run changelog-from-release after describing release note at GitHub repository. It regenerates CHANGELOG.md from releases on GitHub.

go get github.com/rhysd/changelog-from-release
changelog-from-release

Release process

  1. Run export GITHUB_TOKEN=...
  2. Ensure documentation is up-to-date by bash ./docs/gen.sh
  3. Run cargo release which will create a new tag and push it to remote
  4. CI services will prepare binaries
  5. Write release note at https://github.com/rhysd/git-brws/releases
  6. Update changelog by changelog-from-release > CHANGELOG.md
  7. Update Homebrew formula by ./HomebrewFormula/update.sh {ver}