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

Complex conditions are not formatted very nicely #121

Open
ndbroadbent opened this issue Sep 26, 2018 · 1 comment
Open

Complex conditions are not formatted very nicely #121

ndbroadbent opened this issue Sep 26, 2018 · 1 comment

Comments

@ndbroadbent
Copy link

Before:

return if flash[:notice].is_a?(Array) || (
  flash[:notice].present? && (
    flash[:notice][/foo/] ||
    flash[:notice][/bar/]
  )
)

After:

return if flash[:notice].is_a?(Array) || (flash[:notice].present? && (flash[:notice][/foo/] ||
                                                                      flash[:notice][/bar/]))

(I replaced the regular expressions with examples.)

But the reformatted code has a really long line, which I'm trying to avoid.

@NewAlexandria
Copy link

Sometimes humans format things better (*without complex formatting engines). I'd think this is a case for a flag that ignores a block or file. I'm hoping this gem supports that

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

2 participants