@@ -18,28 +18,30 @@ func New(settings *config.GodoxSettings) *goanalysis.Linter {
18
18
Name : linterName ,
19
19
Doc : goanalysis .TheOnlyanalyzerDoc ,
20
20
Run : func (pass * analysis.Pass ) (any , error ) {
21
- runGodox (pass , settings )
22
-
23
- return nil , nil
21
+ return run (pass , settings ), nil
24
22
},
25
23
}
26
24
27
25
return goanalysis .NewLinter (
28
26
linterName ,
29
- "Tool for detection of FIXME, TODO and other comment keywords" ,
27
+ "Detects usage of FIXME, TODO and other keywords inside comments " ,
30
28
[]* analysis.Analyzer {analyzer },
31
29
nil ,
32
30
).WithLoadMode (goanalysis .LoadModeSyntax )
33
31
}
34
32
35
- func runGodox (pass * analysis.Pass , settings * config.GodoxSettings ) {
33
+ func run (pass * analysis.Pass , settings * config.GodoxSettings ) error {
36
34
for _ , file := range pass .Files {
37
35
position , isGoFile := goanalysis .GetGoFilePosition (pass , file )
38
36
if ! isGoFile {
39
37
continue
40
38
}
41
39
42
- messages := godox .Run (file , pass .Fset , settings .Keywords ... )
40
+ messages , err := godox .Run (file , pass .Fset , settings .Keywords ... )
41
+ if err != nil {
42
+ return err
43
+ }
44
+
43
45
if len (messages ) == 0 {
44
46
continue
45
47
}
@@ -55,4 +57,6 @@ func runGodox(pass *analysis.Pass, settings *config.GodoxSettings) {
55
57
})
56
58
}
57
59
}
60
+
61
+ return nil
58
62
}
0 commit comments