Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linter to CI (allow CI to continue of fail, since currently a lot of errors and warnings arise) Added separate linter YAML setting for CI. Add CI step to check `go generate` are up to date. Added sequence ordering to make sure lint and go gen run before tests, which runs before build. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
- Loading branch information
Showing
2 changed files
with
103 additions
and
9 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
run: | ||
timeout: 2m | ||
|
||
output: | ||
print-issued-lines: false | ||
|
||
issues: | ||
max-same-issues: 5 | ||
|
||
linters: | ||
enable: | ||
- containedctx # struct contain a context | ||
- contextcheck # function uses a non-inherited context | ||
- dupl # code clone | ||
- errname # erorrs are named correctly | ||
- errorlint # errors not wrapped for 1.13 | ||
- goconst # strings that should be constants | ||
- gofmt | ||
- gosec # security | ||
- misspell | ||
- nestif # deeply nested ifs | ||
- nilnil # returns nil error and invalid value | ||
- prealloc | ||
- predeclared # shadows Go predeclared identifier | ||
- revive # go-lint replacement | ||
- structcheck # unused struct fields | ||
- stylecheck | ||
- unconvert # unnecessary conversions | ||
- unparam # unused function params | ||
- wastedassign | ||
- whitespace # leading and trailing whitespace | ||
|
||
linters-settings: | ||
stylecheck: | ||
checks: | ||
- "all" | ||
govet: | ||
enable-all: true |