good morning!!!!

Skip to content
Snippets Groups Projects
CONTRIBUTING.md 1.98 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`.
Anmol Sethi's avatar
Anmol Sethi committed
1. `ci/fmt.sh` requires node (specifically prettier).
1. `ci/lint.sh` requires [shellcheck](https://github.com/koalaman/shellcheck#installing).
1. `ci/test.sh` requires the [Autobahn Test suite pip package](https://github.com/crossbario/autobahn-testsuite).
1. `ci/run.sh` runs the above scripts in order.

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` once you have the
[Autobahn Test suite pip package](https://github.com/crossbario/autobahn-testsuite)
installed. `ci/test.sh` just passes a default set of flags to `go test` to collect coverage,
enable the race detector, run benchmarks and also prettifies the output.