-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.Issue to be taken up by new contributors yet unfamiliar with the project.
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Rule Request
- Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
Swift supports both default implicit initialization of optional bindings and explicit.
These are equivalent:
struct A {
var x: Int?
}
struct A {
var x: Int? = nil
}
- Should the rule be configurable, if so what parameters should be configurable?
I think you should be able to enforce it either way, so either "always" or "never" implicit init of optional bindings.
- Provide several examples of what would and wouldn't trigger violations.
For "always", this would trigger a violation:
struct A {
var x: Int? = nil
}For "never", this would trigger a violation:
struct A {
var x: Int?
}
- Should the rule be opt-in or enabled by default? Why?
See README.md for guidelines on when to mark a
rule as opt-in.
Opt-in as it's opinionated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.Issue to be taken up by new contributors yet unfamiliar with the project.