Skip to content
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

Ignore #colorLiteral for line length #742

Closed
Juice805 opened this issue Aug 4, 2016 · 3 comments
Closed

Ignore #colorLiteral for line length #742

Juice805 opened this issue Aug 4, 2016 · 3 comments

Comments

@Juice805
Copy link

Juice805 commented Aug 4, 2016

In Xcode 8 there is the ability to directly input a color from a swatch picker in the editor. In Xcode it simply shows a colored square, however the actual code is:
#colorLiteral(red: 0.2431372549, green: 0.6431372549, blue: 0.6823529412, alpha: 1)

this often trips the line_length rule. Is there a way to configure SwiftLint to ignore specifically this bit without individually marking each occurrence? I would also like to suggest this rule to be a default.

@freak4pc
Copy link
Contributor

freak4pc commented Aug 5, 2016

One thought would be to "remove" #colorLiteral(.*?) from every Line in LineLengthRule.validateFile(_:).

public func validateFile(file: File) -> [StyleViolation] {

@marcelofabri
Copy link
Collaborator

Now that #830 was merged, I think this can be closed

@norio-nomura
Copy link
Collaborator

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants