From e425fdb5912b345eae601330b1aff43dcb7396a8 Mon Sep 17 00:00:00 2001 From: omissis Date: Sat, 10 Sep 2022 18:42:33 +0200 Subject: [PATCH] fix: linting issues and a bug --- .rules/.golangci.yml | 12 ++++++++---- cmd/validate/utils.go | 2 -- cmd/verify/utils.go | 1 - internal/arch/file/except/except.go | 2 +- internal/arch/file/that/end_with.go | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.rules/.golangci.yml b/.rules/.golangci.yml index 912ace4..05d3f32 100644 --- a/.rules/.golangci.yml +++ b/.rules/.golangci.yml @@ -20,23 +20,27 @@ linters: # https://golangci-lint.run/usage/linters/#disabled-by-default-linters--e--enable disable: # todo - - exhaustruct - - forbidigo - - godox - ireturn - revive - varnamelen + # unsupported + - rowserrcheck + - sqlclosecheck + - wastedassign # deprecated - deadcode - exhaustivestruct - golint + - nosnakecase + - structcheck - ifshort - interfacer - maligned - scopelint - varcheck # unused - # TBD + - exhaustruct + - forbidigo linters-settings: decorder: diff --git a/cmd/validate/utils.go b/cmd/validate/utils.go index fbbe745..86f49b2 100644 --- a/cmd/validate/utils.go +++ b/cmd/validate/utils.go @@ -49,7 +49,6 @@ func PrintResults(output string, err error, conf any, configFile string) { } func printTextResults(ptrPaths [][]any, err error, conf any, configFile string) { - // TODO: improve formatting. fmt.Printf("CONFIG FILE %s\n", configFile) for _, path := range ptrPaths { @@ -58,7 +57,6 @@ func printTextResults(ptrPaths [][]any, err error, conf any, configFile string) logx.Fatal(serr) } - // TODO: improve santhosh.JoinPtrPath output. fmt.Printf( "path '%s' contains an invalid configuration value: %+v\n", santhosh.JoinPtrPath(path), diff --git a/cmd/verify/utils.go b/cmd/verify/utils.go index db38003..e210a6e 100644 --- a/cmd/verify/utils.go +++ b/cmd/verify/utils.go @@ -16,7 +16,6 @@ var ErrProjectDoesNotRespectRules = errors.New("project does not respect defined func PrintResults(output, configFile string, results []config.RuleExecutionResult) { switch output { case "text": - // TODO: improve formatting. fmt.Printf("CONFIG FILE %s\n", configFile) for _, r := range results { diff --git a/internal/arch/file/except/except.go b/internal/arch/file/except/except.go index a91f5d1..3457478 100644 --- a/internal/arch/file/except/except.go +++ b/internal/arch/file/except/except.go @@ -20,7 +20,7 @@ func (e *baseExpression) GetErrors() []error { return e.errors } -func (e baseExpression) evaluate(rb rule.Builder, eval evaluateFunc) { +func (e *baseExpression) evaluate(rb rule.Builder, eval evaluateFunc) { frb, ok := rb.(*file.RuleBuilder) if !ok { e.errors = append(e.errors, file.ErrInvalidRuleBuilder) diff --git a/internal/arch/file/that/end_with.go b/internal/arch/file/that/end_with.go index b2adba1..3e54e0f 100644 --- a/internal/arch/file/that/end_with.go +++ b/internal/arch/file/that/end_with.go @@ -23,7 +23,7 @@ func (e *EndWithExpression) GetErrors() []error { return e.errors } -func (e EndWithExpression) Evaluate(rb rule.Builder) { +func (e *EndWithExpression) Evaluate(rb rule.Builder) { frb, ok := rb.(*file.RuleBuilder) if !ok { e.errors = append(e.errors, file.ErrInvalidRuleBuilder)