Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.42 KB

CONTRIBUTING.md

File metadata and controls

47 lines (32 loc) · 1.42 KB

Contributing

Code Setup

  1. Clone repo
  2. Done! (DepCharge uses Go Modules, and so all dependencies will be installed automatically.)

Formatting code

This command will auto-clean the formatting of project code:

gofmt -s -w *.go

Testing and Coverage

On most days: go test -cover

Generate coverage report:

golang/go#22430 (comment)

go test -coverprofile=c.out
sed -i "s/_$(pwd|sed 's/\//\\\//g')/./g" c.out
go tool cover -html=c.out -o=c.html

Strict cover

The CI pipeline will ensure that at least 80% code coverage exists. The following env will ensure this strict coverage percentage is checked. The go test -cover command will fail if your coverage is below 80% and this env is set:

export COVER_STRICT=true

Semantic Versioning

https://semver.org/

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

Examples: