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

[Rule suggestion] Indentation for closure end #326

Closed
NachoSoto opened this issue Jan 8, 2016 · 2 comments
Closed

[Rule suggestion] Indentation for closure end #326

NachoSoto opened this issue Jan 8, 2016 · 2 comments
Labels
rule-request Requests for a new rules.

Comments

@NachoSoto
Copy link
Contributor

Xcode still doesn't know how to indent this one correctly, and I'd love it if SwiftLint could detect it AND correct it, because it really kills my OCD.

I think this only happens when the closure starts in a "overly" indented line. A very common example of this is when using a chained operator, like in RAC:

SignalProducer(values: [1, 2, 3])
    .map { $0 + 1 }
    .startWithNext { number in
        print(number)
}

That's how Xcode indents the closing }, which is really annoying. Instead, it should be aligned:

SignalProducer(values: [1, 2, 3])
    .map { $0 + 1 }
    .startWithNext { number in
        print(number)
    }

I'm happy to implement this myself (I'd love to finally dive in SwiftLint's source), just wanted to make sure other people agree with this too :)

@keith
Copy link
Collaborator

keith commented Jan 8, 2016

Totally agree with this. This is part of our styleguide as well.

@jpsim jpsim added the rule-request Requests for a new rules. label Jan 8, 2016
@jpsim
Copy link
Collaborator

jpsim commented Jan 8, 2016

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

3 participants