Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary empty lines #1080

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestXDGConfigDirIsPrefferedFirst(t *testing.T) {
}

func TestHomeConfigDir(t *testing.T) {

homeDirPath := "/tmp-iofs/home/tester"
AppFs.MkdirAll(homeDirPath, 0755)

Expand Down
3 changes: 0 additions & 3 deletions lint/filefilter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func TestFileFilter(t *testing.T) {
t.Fatalf("should not match %s", fn)
}
}

})

t.Run("just *", func(t *testing.T) {
Expand All @@ -109,7 +108,6 @@ func TestFileFilter(t *testing.T) {
t.Fatalf("should match %s", fn)
}
}

})

t.Run("just ~", func(t *testing.T) {
Expand All @@ -123,6 +121,5 @@ func TestFileFilter(t *testing.T) {
t.Fatalf("should match %s", fn)
}
}

})
}
3 changes: 1 addition & 2 deletions revivelib/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (r *Revive) Lint(patterns ...*LintPattern) (<-chan lint.Failure, error) {
if len(excludePatterns) == 0 { // if no excludes were set
excludePatterns = r.config.Exclude // use those from the configuration
}

// by default if no excludes exclude vendor
if len(excludePatterns) == 0 {
excludePatterns = []string{"vendor/..."}
Expand All @@ -95,7 +95,6 @@ func (r *Revive) Lint(patterns ...*LintPattern) (<-chan lint.Failure, error) {

revive := lint.New(func(file string) ([]byte, error) {
contents, err := os.ReadFile(file)

if err != nil {
return nil, fmt.Errorf("reading file %v: %w", file, err)
}
Expand Down
1 change: 0 additions & 1 deletion rule/enforce-map-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func (r *EnforceMapStyleRule) configure(arguments lint.Arguments) {

var err error
r.enforceMapStyle, err = mapStyleFromString(enforceMapStyle)

if err != nil {
panic(fmt.Sprintf("Invalid argument to the enforce-map-style rule: %v", err))
}
Expand Down
1 change: 0 additions & 1 deletion rule/enforce-slice-style.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func (r *EnforceSliceStyleRule) configure(arguments lint.Arguments) {

var err error
r.enforceSliceStyle, err = sliceStyleFromString(enforceSliceStyle)

if err != nil {
panic(fmt.Sprintf("Invalid argument to the enforce-slice-style rule: %v", err))
}
Expand Down
1 change: 0 additions & 1 deletion rule/line-length-limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func (r *LineLengthLimitRule) configure(arguments lint.Arguments) {
}

r.max = int(maxLength)

}

// Apply applies the rule to given file.
Expand Down
1 change: 0 additions & 1 deletion rule/max-public-structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func (r *MaxPublicStructsRule) configure(arguments lint.Arguments) {
panic(`invalid value passed as argument number to the "max-public-structs" rule`)
}
r.max = maxStructs

}

// Apply applies the rule to given file.
Expand Down
2 changes: 1 addition & 1 deletion rule/redefines-builtin-id.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (w *lintRedefinesBuiltinID) Visit(node ast.Node) ast.Visitor {
if !isTypeOrName {
continue
}

id := obj.Name
if ok, bt := w.isBuiltIn(id); ok {
w.addFailure(name, fmt.Sprintf("redefinition of the built-in %s %s", bt, id))
Expand Down
1 change: 0 additions & 1 deletion rule/var-naming.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (r *VarNamingRule) applyPackageCheckRules(walker *lintNames) {
Category: "naming",
})
}

}

// Apply applies the rule to given file.
Expand Down
3 changes: 1 addition & 2 deletions test/json-data-format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (

func TestJsonDataFormat(t *testing.T) {
testRule(t, "json-data-format-atomic", &rule.AtomicRule{})

}

func TestJsonDataFormatVarNaming(t *testing.T) {
testRule(t, "json-data-format-var-naming", &rule.VarNamingRule{}, &lint.RuleConfig{})

}
5 changes: 0 additions & 5 deletions test/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ func assertFailures(t *testing.T, baseDir string, fi os.FileInfo, src []byte, ru
}

if in.Confidence > 0 {

if in.Confidence != p.Confidence {
t.Errorf("Lint failed at %s:%d; got confidence %f, want %f", fi.Name(), in.Line, p.Confidence, in.Confidence)
}

}

// remove this problem from ps
Expand Down Expand Up @@ -224,11 +222,9 @@ func extractInstructionFromJSON(line string, lineNumber int) (instruction, error
Line: lineNumber,
}
return ins, nil

}

func extractDataMode(line string) string {

if strings.HasPrefix(line, "json") {
return "json"
}
Expand All @@ -237,7 +233,6 @@ func extractDataMode(line string) string {
}

return ""

}

func extractPattern(line string) (string, error) {
Expand Down
1 change: 0 additions & 1 deletion test/var-naming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ func TestVarNaming(t *testing.T) {
testRule(t, "var-naming_skipPackageNameChecks-true", &rule.VarNamingRule{}, &lint.RuleConfig{
Arguments: []any{[]any{}, []any{}, []any{map[string]any{"skipPackageNameChecks": true}}},
})

}