Skip to content

Commit 1e19a50

Browse files
committed
[AllPublicDeclarationsHaveDocumentation] Fix behavior for override methods.
This was mistakenly broken during a refactor and we didn't have test coverage for it. We didn't have test coverage for it because the tests behave differently than the rule does when executed in the whole pipeline, so we need to fix that too. I'm going to do that in a separate PR, because it might have knock-on effects elsewhere. Fixes #651.
1 parent af66fdc commit 1e19a50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SwiftFormat/Rules/AllPublicDeclarationsHaveDocumentation.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ public final class AllPublicDeclarationsHaveDocumentation: SyntaxLintRule {
7777
) {
7878
guard
7979
DocumentationCommentText(extractedFrom: decl.leadingTrivia) == nil,
80-
modifiers.contains(anyOf: [.public, .override])
80+
modifiers.contains(anyOf: [.public]),
81+
!modifiers.contains(anyOf: [.override])
8182
else {
8283
return
8384
}

0 commit comments

Comments
 (0)