Skip to content

Commit 89a72ab

Browse files
committed
feat: update contribution guide and add makefile
1 parent ce2f933 commit 89a72ab

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,24 @@ Contributions are welcome. Please note the [Code of Conduct](CODE_OF_CONDUCT.md)
44

55
## Tool & Repository setup
66

7-
### Recommendations
8-
9-
CI pipelines check all code changes when you open a PR. To not have to go back and fix all issues manually, the following setup is recommended.
10-
117
You will need the following tools:
128

139
- [go](https://go.dev/). For the specific version used, check the [pre-commit workflow](.github/workflows/pre-commit.yml) at the `go-version` configuration
1410
- [pre-commit](https://pre-commit.com/)
1511

16-
Once this is done, run the following:
17-
18-
```sh
19-
# Linters used with pre-commit
20-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
21-
22-
# Set up pre-commit hooks
23-
pre-commit install --hook-type commit-msg --hook-type pre-commit
24-
```
25-
26-
### Hot reload
12+
Once those are installed, run `make setup` to perform the repository setup.
2713

28-
If you want to hot reload the server, using `air` is recommended. Get it with
14+
## Development server
2915

30-
```sh
31-
go install github.com/cosmtrek/air@latest
32-
```
33-
34-
You can then run `GIN_MODE=debug air` in the repository root, which will build and rebuild the project every time the code changes.
16+
Run `make devserver` in the repository root, which will build and rebuild the project every time the code changes.
3517

3618
## Commit messages
3719

3820
This project uses [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
3921
to enable better overview over changes and enables automated tooling based on commit messages.
22+
23+
## Tests & test coverage
24+
25+
The test coverage goal is 100%. Please try to add tests for everything you add to the codebase. If in doubt, you’re always welcome to open an issue and ask for help.
26+
27+
To run tests, run `make test`. To show the test coverage graphically in your browser, run `make coverage`.

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: setup
2+
setup:
3+
pre-commit install --hook-type commit-msg --hook-type pre-commit
4+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
5+
go install github.com/cosmtrek/air@latest
6+
7+
.PHONY: devserver
8+
devserver:
9+
GIN_MODE=debug air
10+
11+
.PHONY: test
12+
test:
13+
go test ./... -covermode=count -coverprofile=coverage.out
14+
15+
.PHONY: coverage
16+
coverage: test
17+
go tool cover -html=coverage.out

0 commit comments

Comments
 (0)