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

brace-style for one-liner conditions, colon-whitespace for tabbed ivars. #380

Open
freak4pc opened this issue Apr 22, 2016 · 0 comments
Open

Comments

@freak4pc
Copy link

There are two separate issues I'm not sure of, if there's a way to bypass or write a custom rule for.

brace-style for one-liner conditions.

Is there any reason this styling isn't considered proper for one-lined conditions?

public func doSomeAction() -> Bool {
    if !conditionMet { return false }

    // More code here ...
    // and some more ...
}

The only way to make this work with brace-style would be a new line which seems excessive for such a readable one-liner.

public func doSomeAction() -> Bool {
    if !conditionMet {
        return false
    }

    // More code here ...
    // and some more ...
}

colon-whitespace for tabbed styled ivars in a class.

Some parts of my code are written this way for readability sake.

image

I wanted all types to be in the same "Column", tab-wise.

Unfortunately using the colon-whitespace rule generates warnings about this, and would force me to do something like this, which is much less readable:

image

Is there any way to write a custom ruling for this, or at least allow something like let var:[spaces]Type instead of a single space? Or would I have to turn off this entire rule, which will prevent actually getting warnings for substantial issues such as let var : Type ?

Thanks for your time on answering this :)

Shai.

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

1 participant