-
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
Colon rules acting differently for same situation. (+ custom question) #730
Comments
It's odd that only 2 of the 3 warnings are rendered for you.... 🤔 I can't reproduce that:
As for making changes to rules to support this kind of style, I'm all for it! The way I'd recommend this be done is to make |
I'm down for trying to write that but I'm still not very acquainted with how the rule mechanism works. Gonna read a bit into it and see how well my brain works today 🤓 |
Resolves issue realm#730.
Resolves issue realm#730.
Well that was easier than I thought: #734. Tested on my pretty massive code base and resolved the issue as expected. Let me know if you're cool with merging this solution or there are any modifications you'd like me to make. My colon:
flexible_right_spacing: true Cheers :) P.S. I wanted to add another unit test for testing this specific case but wasn't completely sure on how to make that work, since |
Resolves issue realm#730.
Not sure why, the Travis build for SPM fails (it can't clone Commandant for some odd reason). |
Resolves issue realm#730.
Resolves issue realm#730.
Hey There :)
In many places in my code I prefer having my colons attached to the identifier, but not with a single space to the type. I think this requires a custom rule (Something like
identifier(no spaces):(multiple spaces)type
), but I'm still not fluent enough in Swiftlint to write this ruleThe odd part is the current rule seems picky on this and sometimes lets these kind of statements pass... I'm not sure what's the difference between the first line that wasn't detected as a "warning" to the other two, which are.
Also, if you could guide me on how to write a rule that will allow the following detection (meaning disabled
colon_rules
and writing something custom that allows multiple spaces after the colon) I'd be happy to read up on it.Thank you!
The text was updated successfully, but these errors were encountered: