-
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
New rule request
Requesting another enhancement to "no_magic_numbers", where it will ignore UIColor definitions.
Since the nature of definiting a color is going to have some "magic numbers", I think it would make sense to just ignore the values -
static let grayColor: UIColor = #colorLiteral(red: 0.7019607843, green: 0.7019607843, blue: 0.7019607843, alpha: 1)
let myColor: UIColor = UIColor(red: 0.6, green: 1.0, blue: 0.2, alpha: 0.52)
let yourColor: UIColor = UIColor(hue: 0.9, saturation: 0.6, brightness: 0.333334, alpha: 1.0)
(including all other UIColor constructors
I don't think this needs to be an "opt-in" configuration...I would think most people would want this by default...but not opposed to it being an opt-in rule.
Hopefully that makes sense!
-Thanks!
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.