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
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
run: | ||
timeout: 10m | ||
|
||
output: | ||
print-issued-lines: true | ||
print-linter-name: true | ||
|
||
issues: | ||
max-same-issues: 0 | ||
max-issues-per-linter: 0 | ||
|
||
linters: | ||
enable: | ||
- containedctx # structs contain a context | ||
# - cyclop # function and package cyclomatic dependencies | ||
- deadcode | ||
- dupl # code clone | ||
- errcheck # unchecked errors | ||
- errname # erorrs are named correctly | ||
- errorlint # errors not wrapped for 1.13 | ||
- goconst # strings that should be constants | ||
- gofmt | ||
- gosec # security | ||
- govet | ||
- misspell | ||
- nestif # deeply nested ifs | ||
- nilnil # returns nil error and invalid value | ||
- prealloc | ||
- predeclared # shadows Go predeclared identifier | ||
- revive # golint replacement | ||
- staticcheck # better go vet | ||
- structcheck # unused struct fields | ||
- stylecheck | ||
- thelper # test helpers are annotated as such | ||
- unconvert # unnecessary conversions | ||
- unparam # unused function params | ||
- wastedassign | ||
- whitespace # leading and trailing whitespace | ||
|
||
linters-settings: | ||
stylecheck: | ||
checks: | ||
- "all" | ||
govet: | ||
check-shadowing: true |
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