mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08:00
golangci-lint: remove skip-cache and restore singleCaseSwitch rule
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
parent
78cd9ae2c3
commit
7e9acc2e46
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
@ -150,7 +150,6 @@ jobs:
|
||||||
uses: golangci/golangci-lint-action@v3.4.0
|
uses: golangci/golangci-lint-action@v3.4.0
|
||||||
with:
|
with:
|
||||||
args: --verbose
|
args: --verbose
|
||||||
skip-cache: true
|
|
||||||
version: v1.51.2
|
version: v1.51.2
|
||||||
fuzzing:
|
fuzzing:
|
||||||
uses: ./.github/workflows/fuzzing.yml
|
uses: ./.github/workflows/fuzzing.yml
|
||||||
|
|
|
@ -24,9 +24,6 @@ issues:
|
||||||
- linters:
|
- linters:
|
||||||
- gocritic
|
- gocritic
|
||||||
text: "appendAssign"
|
text: "appendAssign"
|
||||||
- linters:
|
|
||||||
- gocritic
|
|
||||||
text: "singleCaseSwitch"
|
|
||||||
- path: _test.go
|
- path: _test.go
|
||||||
linters:
|
linters:
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
|
@ -757,8 +757,7 @@ func subqueryTimes(path []parser.Node) (time.Duration, time.Duration, *int64) {
|
||||||
ts int64 = math.MaxInt64
|
ts int64 = math.MaxInt64
|
||||||
)
|
)
|
||||||
for _, node := range path {
|
for _, node := range path {
|
||||||
switch n := node.(type) {
|
if n, ok := node.(*parser.SubqueryExpr); ok {
|
||||||
case *parser.SubqueryExpr:
|
|
||||||
subqOffset += n.OriginalOffset
|
subqOffset += n.OriginalOffset
|
||||||
subqRange += n.Range
|
subqRange += n.Range
|
||||||
if n.Timestamp != nil {
|
if n.Timestamp != nil {
|
||||||
|
@ -847,8 +846,7 @@ func (ng *Engine) getTimeRangesForSelector(s *parser.EvalStmt, n *parser.VectorS
|
||||||
func (ng *Engine) getLastSubqueryInterval(path []parser.Node) time.Duration {
|
func (ng *Engine) getLastSubqueryInterval(path []parser.Node) time.Duration {
|
||||||
var interval time.Duration
|
var interval time.Duration
|
||||||
for _, node := range path {
|
for _, node := range path {
|
||||||
switch n := node.(type) {
|
if n, ok := node.(*parser.SubqueryExpr); ok {
|
||||||
case *parser.SubqueryExpr:
|
|
||||||
interval = n.Step
|
interval = n.Step
|
||||||
if n.Step == 0 {
|
if n.Step == 0 {
|
||||||
interval = time.Duration(ng.noStepSubqueryIntervalFn(durationMilliseconds(n.Range))) * time.Millisecond
|
interval = time.Duration(ng.noStepSubqueryIntervalFn(durationMilliseconds(n.Range))) * time.Millisecond
|
||||||
|
@ -914,8 +912,7 @@ func extractGroupsFromPath(p []parser.Node) (bool, []string) {
|
||||||
if len(p) == 0 {
|
if len(p) == 0 {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
switch n := p[len(p)-1].(type) {
|
if n, ok := p[len(p)-1].(*parser.AggregateExpr); ok {
|
||||||
case *parser.AggregateExpr:
|
|
||||||
return !n.Without, n.Grouping
|
return !n.Without, n.Grouping
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
|
|
Loading…
Reference in a new issue