1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-10-30 23:57:49 +02:00

Update to more recent golangci-lint.

This commit is contained in:
Alec Thomas
2019-07-19 18:57:05 +10:00
parent 2ec7e6c2d1
commit bbbfbe4e7a
5 changed files with 8 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ linters:
- lll
- gocyclo
- dupl
- gochecknoglobals
linters-settings:
govet:

View File

@@ -2,7 +2,7 @@ sudo: false
language: go
script:
- go test -v ./...
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.10.2
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.15.0
- ./bin/golangci-lint run
- git clean -fdx .
after_success:

View File

@@ -11,7 +11,7 @@ import (
rice "github.com/GeertJohan/go.rice"
"github.com/alecthomas/kong"
"github.com/alecthomas/kong-hcl"
konghcl "github.com/alecthomas/kong-hcl"
"github.com/gorilla/csrf"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"

View File

@@ -100,6 +100,7 @@ func TestDelegate(t *testing.T) {
lang, root := makeDelegationTestLexers()
delegate := DelegatingLexer(root, lang)
for _, test := range testdata {
// nolint: scopelint
t.Run(test.name, func(t *testing.T) {
it, err := delegate.Tokenise(nil, test.source)
assert.NoError(t, err)

View File

@@ -619,13 +619,14 @@ func haxePreProcMutator(state *LexerState) error {
}
proc := state.Groups[2]
if proc == "if" {
switch proc {
case "if":
stack = append(stack, state.Stack)
} else if proc == "else" || proc == "elseif" {
case "else", "elseif":
if len(stack) > 0 {
state.Stack = stack[len(stack)-1]
}
} else if proc == "end" {
case "end":
stack = stack[:len(stack)-1]
}