Skip to content

Commit

Permalink
DSU-1270 Add contributing guide (mailgun#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc authored Oct 10, 2022
1 parent 85195ce commit 77622b5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing to holster

## Go version
Use the same version as in the [go.mod](https://github.com/mailgun/holster/blob/master/go.mod#L3) file.

## go.mod and go.sum
`go mod tidy` should be called before commit to add missing and remove unused modules.

## Formatting
Prior to commit all code should be formatted by the [goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports) tool.

### How to configure IDEs
#### GoLand
Go to Preferences → Editor → Code style → Go → Imports → Sorting, choose "goimports".

#### VSCode
1. Call `go install golang.org/x/tools/cmd/goimports@latest`.
1. Install Golang extension.
1. Go to Settings → Extensions → Format tool, choose "goimports".

#### Emacs, Vim, GoSublime, etc.
See [goimports doc](https://pkg.go.dev/golang.org/x/tools/cmd/goimports?tab=doc).

## Linters
We are using [golangci-lint](https://golangci-lint.run/) for static code analysis.

In case of `Lint / lint` GitHub Action failure check the annotations on the PR’s `Files changed` tab.

You could also run `make lint` on your local env to check it.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,6 @@ See package directory `ctxutil`.
Use functions `ctxutil.WithDeadline()`/`WithTimeout()` instead of the `context`
equivalents to log details of the deadline and source file:line where it was
set. Must enable debug logging.

## Contributing code
Please read the [Contribution Guidelines](./CONTRIBUTING.md) before sending patches.

0 comments on commit 77622b5

Please sign in to comment.