-
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
Add spaced_type_declaration rule #1345
Conversation
36a6e5e
to
9a07a6f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1345 +/- ##
==========================================
+ Coverage 81.93% 82.09% +0.15%
==========================================
Files 170 171 +1
Lines 8660 8712 +52
==========================================
+ Hits 7096 7152 +56
+ Misses 1564 1560 -4
Continue to review full report at Codecov.
|
I like this ! |
I'm not sure we should apply this to the project itself. Also, this really should be an opt-in rule. Can you take a look into #640? This will fix that issue, but there're a few ideas there that might be useful to implement, such as making the rule configurable. |
Thanks for the PR, and I definitely agree with @marcelofabri that this rule should be configurable, and that SwiftLint itself would use slightly different settings. |
@marcelofabri @jpsim Thanks for your comments. I'm thinking of a configuration to specify the number of inner padding lines and the number of outer padding lines within a type declaration. They should always be applied symmetrically to the declaration, like this:
What do you think? Is it ok if I force a git push to this branch? |
I think we really should be flexible here, since there's not really a convention. I'd propose the configuration to be like: outer_padding:
beginning: 1
end: 1
inner_padding:
beginning: 1
end: 1 We could also support something like And it's ok to force push this since usually no one works on other's forks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requesting changes based on comments already made
Closing due to lack of activity. |
Added
spaced_type_declaration
rule that warns if either the start or end of a type declaration is not enclosed by two empty lines.For example:
should be written as follows:
I have done two commits: the first one is the actual implementation of this rule and the second one is the result of autocorrecting the entire project so that all tests run successfully. Please let me know if there is something I missed.