-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: make lint more strict and fix all the issues and upgrade githu…
…b actions Signed-off-by: Martin Chodur <[email protected]>
- Loading branch information
Showing
22 changed files
with
182 additions
and
74 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
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 |
---|---|---|
@@ -1,14 +1,68 @@ | ||
linters: | ||
enable: | ||
- contextcheck | ||
- durationcheck | ||
- errcheck | ||
- errname | ||
- errorlint | ||
- gocritic | ||
- godot | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- nilnil | ||
- prealloc | ||
- predeclared | ||
- promlinter | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- goimports | ||
- revive | ||
- promlinter | ||
- gofmt | ||
- errorlint | ||
- usestdlibvars | ||
|
||
linters-settings: | ||
# I'm biased and I'm enabling more than 100 checks | ||
# Might be too much for you. See https://go-critic.com/overview.html | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
# These 3 will detect many cases, but they do sense | ||
# if it's performance oriented code | ||
- hugeParam | ||
- rangeExprCopy | ||
- rangeValCopy | ||
|
||
errcheck: | ||
# Report `a := b.(MyStruct)` when `a, ok := ...` should be. | ||
check-type-assertions: true # Default: false | ||
|
||
# Report skipped checks:`num, _ := strconv.Atoi(numStr)`. | ||
check-blank: true # Default: false | ||
|
||
# Function to skip. | ||
exclude-functions: | ||
- io/ioutil.ReadFile | ||
- io.Copy(*bytes.Buffer) | ||
- io.Copy(os.Stdout) | ||
|
||
govet: | ||
disable: | ||
- fieldalignment # I'm ok to waste some bytes | ||
|
||
nakedret: | ||
# No naked returns, ever. | ||
max-func-lines: 1 # Default: 30 |
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,39 @@ | ||
validationRules: | ||
- name: check-groups | ||
scope: Group | ||
validations: | ||
- type: hasAllowedEvaluationInterval | ||
params: | ||
minimum: "20s" | ||
- type: hasValidPartialResponseStrategy | ||
- type: maxRulesPerGroup | ||
params: | ||
limit: 20 | ||
- name: check-alerts | ||
scope: Alert | ||
validations: | ||
- type: validateLabelTemplates | ||
- type: validateAnnotationTemplates | ||
- type: forIsNotLongerThan | ||
params: | ||
limit: "1d" | ||
- type: keepFiringForIsNotLongerThan | ||
params: | ||
limit: "1d" | ||
- name: check-all-rules | ||
scope: All rules | ||
validations: | ||
- type: nonEmptyLabels | ||
- type: expressionDoesNotUseIrate | ||
- type: validFunctionsOnCounters | ||
- type: rateBeforeAggregation | ||
- type: expressionWithNoMetricName | ||
- type: expressionIsWellFormatted | ||
params: | ||
showExpectedForm: true | ||
- type: expressionDoesNotUseRangeShorterThan | ||
params: | ||
limit: "1m" | ||
- type: expressionDoesNotUseOlderDataThan | ||
params: | ||
limit: "4w" |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/fusakla/promruval/v2 | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/alecthomas/kingpin/v2 v2.4.0 | ||
|
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
Oops, something went wrong.