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

Router: break between curly and catch, like else #1567

Merged
merged 2 commits into from
Nov 30, 2019

Conversation

kitbellew
Copy link
Collaborator

Use the setting for 'else' after curly 'if' to determine whether to add
newlines before 'catch' and 'finally'.

Those who prefer

  if (a) {
    b
  }
  else c

over

  if (a) {
    b
  } else c

likely also prefer

  try {
    a
  }
  finally b

over

  try {
    a
  } finally b

Use the setting for 'else' after curly 'if' to determine whether to add
newlines before 'catch' and 'finally'.

Those who prefer
  if (a) {
    b
  }
  else c
over
  if (a) {
    b
  } else c

likely also prefer
  try {
    a
  }
  finally b
over
  try {
    a
  } finally b
@kitbellew
Copy link
Collaborator Author

@olafurpg @poslegm @tanishiking PTAL. i didn't generate scala-repos, as this behaviour is under an optional flag (and there are unit tests), but let me know if you'd prefer it.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 This looks like a reasonable change that's consistent with alwaysBeforeElseAfterCurlyIf

@olafurpg olafurpg merged commit d873788 into scalameta:master Nov 30, 2019
@kitbellew kitbellew deleted the 1567 branch November 30, 2019 15:30
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

Successfully merging this pull request may close these issues.

2 participants