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

Add note about putting then and else forms on separate lines in if #243

Open
camsaul opened this issue Sep 6, 2022 · 3 comments
Open

Add note about putting then and else forms on separate lines in if #243

camsaul opened this issue Sep 6, 2022 · 3 comments

Comments

@camsaul
Copy link

camsaul commented Sep 6, 2022

I've seen code like

(if (or (something)
        (something-else))
  do-something do-something-else)

in the wild. I would like to be able to point to a style guide note about this. This doesn't apply of course to things like

(if x then else)

Where it's all on one line but if you're going to format it with multiple lines then put the then and else forms on different lines

@bbatsov
Copy link
Owner

bbatsov commented Sep 30, 2022

Yeah, I agree with that suggestion. Generally I think it's fine to have both branches on the same line only for trivial (e.g. one-line conditionals).

@seancorfield
Copy link
Collaborator

PR welcome, at this point.

@seancorfield
Copy link
Collaborator

PR is still welcome :)

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

3 participants