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

Split: switch ignoreIf to tag, allows more control #1737

Merged
merged 4 commits into from
Feb 24, 2020

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented Feb 24, 2020

Rather than enabling a split using a simple boolean flag, let's allow a split to be enabled in some cases. This will allow us to set up some splits which will not be used unless some policy in a specific context decided to use them (for instance, splits for ", {" that would be triggered only if OneArgPerLine policy is used). See #1722, will be used in that PR.

Also, make a few minor cosmetic changes.

@kitbellew
Copy link
Collaborator Author

@olafurpg @tanishiking @poslegm PTAL


object SplitTag extends Enumeration {
Copy link
Collaborator

@poslegm poslegm Feb 24, 2020

Choose a reason for hiding this comment

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

My only issue is a scala.Enumeration usage

sealed trait SplitTag

object SplitTag {
  case object Ignored extends SplitTag
  case object Active extends SplitTag
}

sealed hierarchies is a little bit verbose, but a simple and reliable syntax.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do, thank you.

@kitbellew kitbellew merged commit f6c8c1a into scalameta:master Feb 24, 2020
@kitbellew kitbellew deleted the 1737 branch February 24, 2020 21:07
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