Skip to content

Latest commit

 

History

History
92 lines (71 loc) · 2.21 KB

CONTRIBUTING.md

File metadata and controls

92 lines (71 loc) · 2.21 KB

Contributing

The following document outlines how to contribute to the tb project.

Table of Contents

Requirements

To build and run tb locally you will need to install go. This can likely be done through your package manager or by going to https://golang.org/doc/install.

For example, on macOS you can use homebrew by running:

brew install go

Setup

First clone the repo to your desired location:

git clone [email protected]:TouchBistro/tb.git

Then in the root of the repo run the following to install all dependencies and tools required:

make setup

Building

Running locally

To build the app run:

go build

This will create a binary named tb in the current directory. You can run it be doing ./tb.

Running globally

If you want to be able to run if from anywhere you can run:

go install

This will installing it in the bin directory in your go path.

NOTE: You will need to add the go bin to your PATH variable. Add the following to your .zshrc or .bash_profile:

export PATH="$(go env GOPATH)/bin:$PATH"

Then run source ~/.zshrc or source ~/.bash_profile.

Remove global build

The global build will likely take precedence over the version installed with brew. This is fine during development but might be annoying otherwise.

To remove the globally installed build run the following from the root directory of the repo:

make go-uninstall

Linting

To run the linter run:

make lint

Testing

To run the tests run:

make test

This will output code coverage information to the coverage directory. You can open the coverage/coverage.html file in your browser to visually see the coverage in each file.

Cleaning Up

To remove the build and another other generated files run:

make clean

Additionally if go.sum gets modified on build, please run go mod tidy to clean it up before committing and pushing changes.