Skip to content

Commit 57a492e

Browse files
committed
review: update implementation
1 parent e712dff commit 57a492e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.golangci.reference.yml

+3
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ linters-settings:
402402
# If lower than 0, disable the check.
403403
# Default: 40
404404
statements: -1
405+
# Ignore comments when counting lines.
406+
# Default false
407+
ignore-comments: true
405408

406409
gci:
407410
# DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.

pkg/config/linters_settings.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ func (p *ForbidigoPattern) MarshalString() ([]byte, error) {
380380
}
381381

382382
type FunlenSettings struct {
383-
Lines int
384-
Statements int
383+
Lines int
384+
Statements int
385+
IgnoreComments bool `mapstructure:"ignore-comments"`
385386
}
386387

387388
type GciSettings struct {

pkg/golinters/funlen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func NewFunlen(settings *config.FunlenSettings) *goanalysis.Linter {
5252
func runFunlen(pass *analysis.Pass, settings *config.FunlenSettings) []goanalysis.Issue {
5353
var lintIssues []funlen.Message
5454
for _, file := range pass.Files {
55-
fileIssues := funlen.Run(file, pass.Fset, settings.Lines, settings.Statements)
55+
fileIssues := funlen.Run(file, pass.Fset, settings.Lines, settings.Statements, settings.IgnoreComments)
5656
lintIssues = append(lintIssues, fileIssues...)
5757
}
5858

0 commit comments

Comments
 (0)