Skip to content

Commit

Permalink
fix: linting issues and a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Sep 10, 2022
1 parent 3a29b79 commit e425fdb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .rules/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions cmd/validate/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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),
Expand Down
1 change: 0 additions & 1 deletion cmd/verify/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/arch/file/except/except.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/arch/file/that/end_with.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e425fdb

Please # to comment.