-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add details about code check to testing doc
Introduce section to explain the new Makefile targets.
- Loading branch information
1 parent
4bc04b2
commit 23f5763
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,16 @@ This allow us to use test doubles in the unit tests, from where we can instantia | |
|
||
Counterfeiter is required by the code generator scripts. Run `make install-counterfeiter` to add counterfeiter to your `GOPATH`. | ||
|
||
### Static code analysis and linting | ||
|
||
Run `make sanity-check` to run a collection of static code analyser and linters to check the code for issues, for example ineffective assignments, unused variables, missing comments, misspellings and so on. Each check also has an individual Make target to check: | ||
|
||
- `make govet` examines Go source code and reports suspicious constructs | ||
- `make ineffassign` checks Go source for variable assignments that are not used (i.e. overridden) | ||
- `make golint` runs a linter against the Go source | ||
- `make misspell` checks for TYPOs | ||
- `make staticcheck` performs more complex static code analysis to find unused code and other issues | ||
|
||
## Unit Tests | ||
|
||
We use unit tests to provide coverage and ensure that our functions are behaving as expected, but also to assert the behaviour of the controllers during Reconciliations. | ||
|
@@ -208,4 +218,3 @@ make test-e2e \ | |
TEST_PRIVATE_GITLAB="[email protected]:<youruser>/<your-repo>.git" \ | ||
TEST_SOURCE_SECRET="<secret-name>" | ||
``` | ||
|