-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a validate phase to the CI which runs a linter. Also fixes linter issues discovered during the initial run
- Loading branch information
1 parent
7e4a51b
commit 9480a3e
Showing
15 changed files
with
128 additions
and
37 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,67 @@ | ||
{ | ||
"linters": { | ||
"disable-all": true, | ||
"enable": [ | ||
"govet", | ||
"revive", | ||
"goimports", | ||
"misspell", | ||
"ineffassign", | ||
"gofmt" | ||
] | ||
}, | ||
"linters-settings": { | ||
"govet": { | ||
"check-shadowing": false | ||
}, | ||
"gofmt": { | ||
"simplify": false | ||
} | ||
}, | ||
"run": { | ||
"skip-dirs": [ | ||
"vendor", | ||
"tests", | ||
"pkg/client", | ||
"pkg/generated" | ||
], | ||
"tests": false, | ||
"timeout": "10m" | ||
}, | ||
"issues": { | ||
"exclude-rules": [ | ||
{ | ||
"linters": "govet", | ||
"text": "^(nilness|structtag)" | ||
}, | ||
{ | ||
"path":"pkg/apis/management.cattle.io/v3/globaldns_types.go", | ||
"text":".*lobalDns.*" | ||
}, | ||
{ | ||
"path": "pkg/apis/management.cattle.io/v3/zz_generated_register.go", | ||
"text":".*lobalDns.*" | ||
}, | ||
{ | ||
"path":"pkg/apis/management.cattle.io/v3/zz_generated_list_types.go", | ||
"text":".*lobalDns.*" | ||
}, | ||
{ | ||
"linters": "revive", | ||
"text": "should have comment" | ||
}, | ||
{ | ||
"linters": "revive", | ||
"text": "should be of the form" | ||
}, | ||
{ | ||
"linters": "revive", | ||
"text": "by other packages, and that stutters" | ||
}, | ||
{ | ||
"linters": "typecheck", | ||
"text": "imported but not used as apierrors" | ||
} | ||
] | ||
} | ||
} |
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
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
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
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
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
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
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
golangci-lint run | ||
go mod tidy | ||
go mod verify | ||
unclean=$(g status --porcelain --untracked-files=no) | ||
if [ -n "$unclean" ]; then | ||
echo "Encountered dirty repo!"; | ||
echo "$unclean"; | ||
exit 1; | ||
fi |