good morning!!!!

Skip to content
Snippets Groups Projects
CONTRIBUTING.md 2.01 KiB
Newer Older
Anmol Sethi's avatar
Anmol Sethi committed
# Contributing

## Issues

Anmol Sethi's avatar
Anmol Sethi committed
Please be as descriptive as possible.
Anmol Sethi's avatar
Anmol Sethi committed

Anmol Sethi's avatar
Anmol Sethi committed
Reproducible examples are key to finding and fixing bugs.
Anmol Sethi's avatar
Anmol Sethi committed
## Pull requests
Anmol Sethi's avatar
Anmol Sethi committed

Good issues for first time contributors are marked as such. Please feel free to
reach out for clarification on what needs to be done.

Split up large changes into several small descriptive commits.
Anmol Sethi's avatar
Anmol Sethi committed

Capitalize the first word in the commit message title.
Anmol Sethi's avatar
Anmol Sethi committed

The commit message title should use the verb tense + phrase that completes the blank in
Anmol Sethi's avatar
Anmol Sethi committed

> This change modifies websocket to \_\_\_\_\_\_\_\_\_
Anmol Sethi's avatar
Anmol Sethi committed

Anmol Sethi's avatar
Anmol Sethi committed
Be sure to [correctly link](https://help.github.com/en/articles/closing-issues-using-keywords)
to an existing issue if one exists. In general, create an issue before a PR to get some
discussion going and to make sure you do not spend time on a PR that may be rejected.
Anmol Sethi's avatar
Anmol Sethi committed

Anmol Sethi's avatar
Anmol Sethi committed
CI must pass on your changes for them to be merged.
Anmol Sethi's avatar
Anmol Sethi committed

Anmol Sethi's avatar
Anmol Sethi committed
### CI
Anmol Sethi's avatar
Anmol Sethi committed
CI will ensure your code is formatted correctly, passes linting and tests.
It will collect coverage and report it to [codecov](https://codecov.io/gh/nhooyr/websocket)
and also upload a `out/coverage.html` artifact that you can click on to interactively
browse coverage.
Anmol Sethi's avatar
Anmol Sethi committed
You can run CI locally. The various steps are located in `ci/*.sh`.
1. `ci/fmt.sh` which requires node (specifically prettier).
1. `ci/lint.sh` which requires [shellcheck](https://github.com/koalaman/shellcheck#installing).
1. `ci/test.sh`
1. `ci/run.sh` which runs the above scripts in order.
Anmol Sethi's avatar
Anmol Sethi committed

For coverage details locally, please see `ci/out/coverage.html` after running `ci/test.sh`.

See [ci/image/Dockerfile](ci/image/Dockerfile) for the installation of the CI dependencies on Ubuntu.

You can also run tests normally with `go test`. `ci/test.sh` just passes a default set of flags to
`go test` to collect coverage, enable the race detector and also prettifies the output.
You can pass flags to `ci/test.sh` if you want to run a specific test or otherwise
control the behaviour of `go test`.

Coverage percentage from codecov and the CI scripts will be different because they are calculated differently.