{"action":"opened","issue":{"url":"https://api.github.com/repos/scalameta/scalafmt/issues/1256","repository_url":"https://api.github.com/repos/scalameta/scalafmt","labels_url":"https://api.github.com/repos/scalameta/scalafmt/issues/1256/labels{/name}","comments_url":"https://api.github.com/repos/scalameta/scalafmt/issues/1256/comments","events_url":"https://api.github.com/repos/scalameta/scalafmt/issues/1256/events","html_url":"https://github.com/scalameta/scalafmt/issues/1256","id":351125333,"node_id":"MDU6SXNzdWUzNTExMjUzMzM=","number":1256,"title":"Preserve newlines in for comprehension generators and values","user":{"login":"psttf","id":713387,"node_id":"MDQ6VXNlcjcxMzM4Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/713387?v=4","gravatar_id":"","url":"https://api.github.com/users/psttf","html_url":"https://github.com/psttf","followers_url":"https://api.github.com/users/psttf/followers","following_url":"https://api.github.com/users/psttf/following{/other_user}","gists_url":"https://api.github.com/users/psttf/gists{/gist_id}","starred_url":"https://api.github.com/users/psttf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psttf/subscriptions","organizations_url":"https://api.github.com/users/psttf/orgs","repos_url":"https://api.github.com/users/psttf/repos","events_url":"https://api.github.com/users/psttf/events{/privacy}","received_events_url":"https://api.github.com/users/psttf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-16T09:27:18Z","updated_at":"2018-08-16T09:27:18Z","closed_at":null,"author_association":"NONE","body":"Since newlines are preserved after `=` in `val`s and `def`s it seems reasonable to do the same inside `for`s and preserve newlines after `<-` as well as `=`:\r\n\r\nOriginal:\r\n\r\n    for {\r\n      myLongBooleanValue <- \r\n        some.very.very.very.very.very.very.long.option.map(_ => true)\r\n      myResult = \r\n        if (myLongBooleanValue) compute_one_thing\r\n        else 0 compute_another_thing\r\n    } yield myResult\r\n\r\nScalafmt:\r\n\r\n    for {\r\n      myLongBooleanValue <- some.very.very.very.very.very.very.long.option\r\n        .map(_ => true)\r\n      myResult = if (myLongBooleanValue) compute_one_thing\r\n      else 0 compute_another_thing\r\n    } yield myResult\r\n\r\nThe original version seems more readable to me and It would be nice if such inputs were not reformatted.\r\n\r\nUsing scalafmt 1.6.0-RC3, `style = default`"}}
{"actor":{"display_login":"psttf"}}