-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
valid_docs rule shouldn't be enforced for common UIKit method overrides #284
Comments
I brought this up somewhere but IMO we should ignore everything that is an |
I think so too |
The So what's the motivating factor for writing documentation-style comments for an overridden declaration without those docs being fully valid? If it's a note on the implementation to developers (e.g. not users of the API), then why not use a regular style comment? If it is for users of the API, the docs should be complete, no? |
I have slightly different case with the same warning. Having this protocol and implementation: /// test proto description
public protocol TestProto {
/// - Returns: some string
/// - Parameter sampleParam: yet another parameter
func sampleFunc(sampleParam: String) -> String
}
/// Sample proto documentation
public struct SampleStruct: TestProto {
/// - seealso: `TestProto`
public func sampleFunc(sampleParam: String) -> String {
return ""
}
} I use jazzy for doc generation, |
Because it is only partially documented. |
I don't mind to duplicate the description from the protocol, but that's as weird as documenting the method override, i think. |
@Sega-Zero Current valid_docs rules implementation is case sensitive and expecting lower case keywords such as |
Note that Swiftlint insisting on (This is under “Make documentation comments tool-friendly.”) |
Thanks for sharing that link @pcantrell. I've been struggling with this since originally writing the rule, where it's not always appropriate to follow the Swift documentation syntax exactly. Of course, it's always possible to just disable a rule, either locally or globally, but I'm open to loosening the constraints on the valid docs rule to reduce the number of false violations. |
It’s the inherent problem of linting tools: the rules that are truly absolute tend to be fairly mindless. Most fall into a nuanced area that requires some human judgement, and deciding where to draw the linter line is a tricky call! |
Closing this since we removed this rule. |
For example if I override shouldAutoroate I shouldn't have to document the return type.
The text was updated successfully, but these errors were encountered: