@@ -23,7 +23,7 @@ func (Lll) Desc() string {
23
23
return "Reports long lines"
24
24
}
25
25
26
- func (lint Lll ) getIssuesForFile (filename string , maxLineLen int ) ([]result.Issue , error ) {
26
+ func (lint Lll ) getIssuesForFile (filename string , maxLineLen int , tabSpaces string ) ([]result.Issue , error ) {
27
27
var res []result.Issue
28
28
29
29
f , err := os .Open (filename )
@@ -36,7 +36,7 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int) ([]result.Issu
36
36
scanner := bufio .NewScanner (f )
37
37
for scanner .Scan () {
38
38
line := scanner .Text ()
39
- line = strings .Replace (line , "\t " , " " , - 1 )
39
+ line = strings .Replace (line , "\t " , tabSpaces , - 1 )
40
40
lineLen := utf8 .RuneCountInString (line )
41
41
if lineLen > maxLineLen {
42
42
res = append (res , result.Issue {
@@ -61,8 +61,9 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int) ([]result.Issu
61
61
62
62
func (lint Lll ) Run (ctx context.Context , lintCtx * linter.Context ) ([]result.Issue , error ) {
63
63
var res []result.Issue
64
+ spaces := strings .Repeat (" " , lintCtx .Settings ().Lll .TabWidth )
64
65
for _ , f := range lintCtx .PkgProgram .Files (lintCtx .Cfg .Run .AnalyzeTests ) {
65
- issues , err := lint .getIssuesForFile (f , lintCtx .Settings ().Lll .LineLength )
66
+ issues , err := lint .getIssuesForFile (f , lintCtx .Settings ().Lll .LineLength , spaces )
66
67
if err != nil {
67
68
return nil , err
68
69
}
0 commit comments