Skip to content

Commit

Permalink
chore: resolve lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancurrah committed Mar 19, 2024
1 parent 3a55957 commit 07c893a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/filesearch/filesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Find(cwd string, skipTests bool, args []string) []string {
func expandGoWildcard(root string) []string {
foundFiles := []string{}

_ = filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
_ = filepath.Walk(root, func(path string, info os.FileInfo, _ error) error {
// Only append go foundFiles.
if !strings.HasSuffix(info.Name(), ".go") {
return nil
Expand Down
2 changes: 1 addition & 1 deletion processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (p *Processor) addError(fileset *token.FileSet, pos token.Pos, reason strin
//
// It works by iterating over the dependant modules specified in the require
// directive, checking if the module domain or full name is in the allowed list.
func (p *Processor) SetBlockedModules() { //nolint:gocognit,funlen
func (p *Processor) SetBlockedModules() { //nolint:funlen
blockedModules := make(map[string][]string, len(p.Modfile.Require))
currentModuleName := p.Modfile.Module.Mod.Path
lintedModules := p.Modfile.Require
Expand Down
2 changes: 2 additions & 0 deletions processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ func TestProcessorProcessFiles(t *testing.T) { //nolint:funlen
t.Run(tt.testName, func(t *testing.T) {
tt.processor.SetBlockedModules()
results := tt.processor.ProcessFiles(filteredFiles)

if len(results) == 0 {
t.Fatal("result should be greater than zero")
}

foundWantReason := false
allReasons := make([]string, 0, len(results))

for _, result := range results {
allReasons = append(allReasons, result.String())

Expand Down

0 comments on commit 07c893a

Please sign in to comment.