From bef0e01267f00b44e07b6dc5dd6961b2910ee4f4 Mon Sep 17 00:00:00 2001 From: Sylvia Wang Date: Thu, 10 Aug 2023 17:50:10 -0700 Subject: [PATCH] fix: linter issue --- analyze.go | 2 +- build_test.go | 2 +- lex.go | 2 +- parse.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/analyze.go b/analyze.go index cfb9164e..d37e16cf 100644 --- a/analyze.go +++ b/analyze.go @@ -89,7 +89,7 @@ func enterBlockCtx(stmt *Directive, ctx blockCtx) blockCtx { return append(ctx, stmt.Directive) } -//nolint:gocyclo,cyclop,funlen,gocognit +//nolint:gocyclo,gocognit,cyclop,funlen func analyze(fname string, stmt *Directive, term string, ctx blockCtx, options *ParseOptions) error { masks, knownDirective := directives[stmt.Directive] currCtx, knownContext := contexts[ctx.key()] diff --git a/build_test.go b/build_test.go index 9763e82d..fb13130c 100644 --- a/build_test.go +++ b/build_test.go @@ -367,7 +367,7 @@ var compareFixtures = []compareFixture{ {"empty-config", ParseOptions{}}, } -//nolint:gocognit,cyclop,funlen +//nolint:cyclop,funlen,gocognit func TestCompareParsedAndBuilt(t *testing.T) { t.Parallel() for _, fixture := range compareFixtures { diff --git a/lex.go b/lex.go index 8500da49..942047a4 100644 --- a/lex.go +++ b/lex.go @@ -49,7 +49,7 @@ func Lex(reader io.Reader) chan NgxToken { return tc } -//nolint:gocyclo,cyclop,funlen,gocognit +//nolint:gocyclo,gocognit,cyclop,funlen func tokenize(reader io.Reader, tokenCh chan NgxToken) { token := strings.Builder{} tokenLine := 1 diff --git a/parse.go b/parse.go index 548c8988..26d286b5 100644 --- a/parse.go +++ b/parse.go @@ -190,7 +190,7 @@ func (p *parser) openFile(path string) (io.Reader, error) { // parse Recursively parses directives from an nginx config context. // -//nolint:gocyclo,cyclop,funlen,gocognit,maintidx,nonamedreturns +//nolint:gocyclo,gocognit,cyclop,funlen,maintidx,nonamedreturns func (p *parser) parse(parsing *Config, tokens <-chan NgxToken, ctx blockCtx, consume bool) (parsed Directives, err error) { var tokenOk bool // parse recursively by pulling from a flat stream of tokens