Skip to content

Commit a613280

Browse files
author
chavacava
committed
minor change
1 parent 2a7e60a commit a613280

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

rule/comments-density.go

+14-11
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,21 @@ func (r *CommentsDensityRule) configure(arguments lint.Arguments) {
2222
r.Lock()
2323
defer r.Unlock()
2424

25-
if !r.configured {
26-
r.configured = true
27-
if len(arguments) < 1 {
28-
r.minumumCommentsDensity = defaultMinimumCommentsPercentage
29-
return
30-
}
25+
if r.configured {
26+
return
27+
}
3128

32-
var ok bool
33-
r.minumumCommentsDensity, ok = arguments[0].(int64)
34-
if !ok {
35-
panic(fmt.Sprintf("invalid argument for %q rule: argument should be an int, got %T", r.Name(), arguments[0]))
36-
}
29+
r.configured = true
30+
31+
if len(arguments) < 1 {
32+
r.minumumCommentsDensity = defaultMinimumCommentsPercentage
33+
return
34+
}
35+
36+
var ok bool
37+
r.minumumCommentsDensity, ok = arguments[0].(int64)
38+
if !ok {
39+
panic(fmt.Sprintf("invalid argument for %q rule: argument should be an int, got %T", r.Name(), arguments[0]))
3740
}
3841
}
3942

0 commit comments

Comments
 (0)