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

Ability to align custom token #161

Open
kiritsuku opened this issue Feb 18, 2016 · 1 comment
Open

Ability to align custom token #161

kiritsuku opened this issue Feb 18, 2016 · 1 comment

Comments

@kiritsuku
Copy link
Member

From @Driox on December 7, 2015 14:39

I use PlayMonadicAction (https://github.com/Kanaka-io/play-monadic-actions) and I write this kins of code

def action1(userId: String) = Action.async(parse.json) {
    request =>
      for {
        su   <- request.body.validate[StatusUpdate] ?| BadRequest(JsError.toFlatJson(_:ActionDSL.JsErrorContent))
        user <- SomeService.findUser(userId)        ?| NotFound
        _    <- SomeService.performUpdate(user, su) ?| Conflict
      } yield NoContent
  }

I would like to align the ?| operator vertically. Just like the => of case statement in pattern matching.
More generally, I want to align vertically every custom operator I will use.
Is it possible ?
If not I'll be glad to help you write it but I need some doc / explaination about how scalariform is working internally

Copied from original issue: daniel-trinh#97

@kiritsuku
Copy link
Member Author

From @aki-s on January 6, 2016 11:29

Me too.

This case also applies to the following simple case;

 Map( 
      one   -> 1,
      two   -> 2,
      three -> 3)

becomes

 Map( 
      one -> 1,
      two -> 2,
      three -> 3)

When the length of each key and value becomes large, it degrades readability.
I know If you want the code 'as is', you can write directive "// format: OFF" and "//format: ON" ( https://github.com/daniel-trinh/scalariform#format-onoff ),
but this additional rule is annoying. (comment should be used only for code, not to the external tools.)

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