Skip to content

Commit 4c770d5

Browse files
committed
fix superfluousOrMissingParameterDocumentation regression
where commentParameters.count > labelsAndParams.count
1 parent 889ecef commit 4c770d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/SwiftLintFramework/Rules/ValidDocsRule.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ func superfluousOrMissingParameterDocumentation(declaration: String, substructur
9999
let commentParameters = commentParameterMatches.map { match in
100100
return (comment as NSString).substringWithRange(match.rangeAtIndex(1))
101101
}
102-
if labelsAndParams.count - commentParameters.count > optionallyDocumentedParameterCount {
102+
if commentParameters.count > labelsAndParams.count ||
103+
labelsAndParams.count - commentParameters.count > optionallyDocumentedParameterCount {
103104
return true
104105
}
105106
return !zip(commentParameters, labelsAndParams).filter {

0 commit comments

Comments
 (0)