Skip to content

Commit

Permalink
New linter 'Revive' and config; go.mod/sum updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaughany committed Aug 13, 2021
1 parent 846558f commit ea3b691
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
11 changes: 9 additions & 2 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ echo -e "\e[1mRunning 'go vet ./...'\e[0m"
go vet ./...

echo -e "\e[1mRunning 'golint ./...'\e[0m"
golint ./...
golint --min_confidence 0.2 ./...

echo -e "\e[1mRunning 'staticheck ./...'\e[0m"
staticcheck ./...

echo -e "\e[1mRunning 'go tool fix --diff .'\e[0m"
go tool fix --diff .

echo -e "\e[1mDone.\e[0m"
echo -e "\e[1mRunning 'revive ./...'\e[0m"
revive -config revive.toml ./...

echo -e "\e[1mRunning 'golangci-lint run'\e[0m"
# golangci-lint run --enable-all
golangci-lint run

echo -e "\e[1mDone.\e[0m"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.16
require (
code.cloudfoundry.org/bytefmt v0.0.0-20210608160410-67692ebc98de
github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
29 changes: 29 additions & 0 deletions revive.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ignoreGeneratedHeader = false
severity = "warning"
confidence = 0.3
errorCode = 0
warningCode = 0

enableAllRules = true

[rule.file-header]
Disabled = true
# Arguments = ["This is a header."]
[rule.function-length]
# Disabled = true
Arguments = [10, 20]
[rule.line-length-limit]
Disabled = true
[rule.max-public-structs]
Disabled = true
[rule.nested-structs]
Disabled = true

[rule.argument-limit]
Arguments = [5]
[rule.cognitive-complexity]
Arguments = [7]
[rule.cyclomatic]
arguments = [10]
[rule.function-result-limit]
Arguments = [2]

0 comments on commit ea3b691

Please sign in to comment.