Lint inline documentation - #6905
Open
YuryLapitsky-TomTom wants to merge 6 commits into
Open
Conversation
Generated by 🚫 Danger |
YuryLapitsky-TomTom
force-pushed
the
lint/inline-documentation
branch
from
August 31, 2026 15:02
10e9144 to
d733332
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YuryLapitsky-TomTom
force-pushed
the
lint/inline-documentation
branch
from
August 31, 2026 16:18
ba78bd7 to
ffdc837
Compare
YuryLapitsky-TomTom
marked this pull request as ready for review
August 31, 2026 16:20
- Move access modifier to extension (extension_access_modifier) - Move opening braces to end of multi-line conditions (opening_brace) - Suppress type_body_length for Visitor class Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Static NSRegularExpression instances can trigger Thread Sanitizer due to ICU internal state accessed from concurrent test threads. Replace all five patterns with Swift Regex literals (#/.../# extended form) which are value-typed and have no shared mutable state. Also removes the force_try swiftlint suppressions that were needed for try! NSRegularExpression(...). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Disable the new opt-in rule in the project's own .swiftlint.yml to avoid violations in existing SwiftLint source files. Also remove superfluous type_body_length disable comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New rule: `doc_comment_parameter`
Adds an opt-in lint rule that validates documentation comments on `func`, `init`, and `subscript` declarations are consistent with their actual signatures.
What it checks
Configuration
```yaml
doc_comment_parameter:
severity: warning # default
validate_returns: false # default
validate_throws: false # default
enforce_parameter_syntax: false # default
```
Examples
```swift
// ✅ OK
/// Updates the label.
/// - Parameter with: The new text.
func updateLabel(with text: String) {}
// ✅ OK — no doc comment, no violation
func process(value: Int) {}
// ❌ Extra parameter that doesn't exist
/// - Parameter ↓ghost: Does not exist.
func greet() {}
// ❌ One of two params missing from docs
/// - Parameter lhs: Left side.
↓func add(lhs: Int, rhs: Int) -> Int { lhs + rhs }
```
Notes