You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often need trivial public init functions to allow an object to created. But this causes a missing_docs warning from SwiftLint unless we add doc comments with something generic like "Initializes xyz".
Why should this rule be added? Share links to existing discussion about what
It would be nice if there was a way to disable missing_docs for public init functions with no parameters, such as excludes_trivial_init. This would let us keep missing_docs for the other situation.
Provide several examples of what would and wouldn't trigger violations.
Example where it should not trigger if excludes_trivial_init is set.
public init() {}
public init() {}
public init() {
self.property1 = 123
}
/// Initializes with a name.
public init(name: String) {
self.name = name
}
Example where it should still trigger even if excludes_trivial_init is set.
public init(name: String) {
self.name = name
}
Should the rule be configurable, if so what parameters should be configurable?
Yes, a configuration option, such as excludes_trivial_init, would be important.
Should the rule be opt-in or enabled by default? Why?
Opt-in to avoid causing problems for existing code.
The text was updated successfully, but these errors were encountered:
New Issue Checklist
New rule request
We often need trivial public init functions to allow an object to created. But this causes a missing_docs warning from SwiftLint unless we add doc comments with something generic like "Initializes xyz".
Why should this rule be added? Share links to existing discussion about what
It would be nice if there was a way to disable missing_docs for public init functions with no parameters, such as excludes_trivial_init. This would let us keep missing_docs for the other situation.
Provide several examples of what would and wouldn't trigger violations.
Example where it should not trigger if excludes_trivial_init is set.
Example where it should still trigger even if excludes_trivial_init is set.
Should the rule be configurable, if so what parameters should be configurable?
Yes, a configuration option, such as excludes_trivial_init, would be important.
Should the rule be opt-in or enabled by default? Why?
Opt-in to avoid causing problems for existing code.
The text was updated successfully, but these errors were encountered: