{"action":"created","issue":{"url":"https://api.github.com/repos/weavejester/cljfmt/issues/152","repository_url":"https://api.github.com/repos/weavejester/cljfmt","labels_url":"https://api.github.com/repos/weavejester/cljfmt/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/weavejester/cljfmt/issues/152/comments","events_url":"https://api.github.com/repos/weavejester/cljfmt/issues/152/events","html_url":"https://github.com/weavejester/cljfmt/issues/152","id":385818497,"node_id":"MDU6SXNzdWUzODU4MTg0OTc=","number":152,"title":"Some ”empty” forms get inconsistent formatting when keeping surrounding whitespace","user":{"login":"PEZ","id":30010,"node_id":"MDQ6VXNlcjMwMDEw","avatar_url":"https://avatars2.githubusercontent.com/u/30010?v=4","gravatar_id":"","url":"https://api.github.com/users/PEZ","html_url":"https://github.com/PEZ","followers_url":"https://api.github.com/users/PEZ/followers","following_url":"https://api.github.com/users/PEZ/following{/other_user}","gists_url":"https://api.github.com/users/PEZ/gists{/gist_id}","starred_url":"https://api.github.com/users/PEZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PEZ/subscriptions","organizations_url":"https://api.github.com/users/PEZ/orgs","repos_url":"https://api.github.com/users/PEZ/repos","events_url":"https://api.github.com/users/PEZ/events{/privacy}","received_events_url":"https://api.github.com/users/PEZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-29T16:27:34Z","updated_at":"2018-12-02T11:46:31Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When indenting and keeping surrounding whitespace some forms, like `comment` and `let` get the wrong formatting if they are ”empty” and have newlines. Like this:\r\n\r\n```clojure\r\n  (cljfmt/reformat-string \"(let []\\n)\"\r\n                          {:remove-surrounding-whitespace? false\r\n                           :indentation? true}) => \"(let []\\n     )\"\r\n```\r\n\r\nI.e. the closing paren is aligned with the first argument of the form. Which is not how let is fomatted otherwise. It should have two space indents for the code below the bindings box.\r\n\r\nFor empty `comment` forms it is that the closing paren gets one indent when it should have two, like it has when it has contents. I think I have noticed this on other forms too.\r\n\r\nFor Calva Formatter this is important because it is used while typing and many forms start out empty.\r\n"},"comment":{"url":"https://api.github.com/repos/weavejester/cljfmt/issues/comments/443501369","html_url":"https://github.com/weavejester/cljfmt/issues/152#issuecomment-443501369","issue_url":"https://api.github.com/repos/weavejester/cljfmt/issues/152","id":443501369,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzUwMTM2OQ==","user":{"login":"pfeodrippe","id":2124834,"node_id":"MDQ6VXNlcjIxMjQ4MzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2124834?v=4","gravatar_id":"","url":"https://api.github.com/users/pfeodrippe","html_url":"https://github.com/pfeodrippe","followers_url":"https://api.github.com/users/pfeodrippe/followers","following_url":"https://api.github.com/users/pfeodrippe/following{/other_user}","gists_url":"https://api.github.com/users/pfeodrippe/gists{/gist_id}","starred_url":"https://api.github.com/users/pfeodrippe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfeodrippe/subscriptions","organizations_url":"https://api.github.com/users/pfeodrippe/orgs","repos_url":"https://api.github.com/users/pfeodrippe/repos","events_url":"https://api.github.com/users/pfeodrippe/events{/privacy}","received_events_url":"https://api.github.com/users/pfeodrippe/received_events","type":"User","site_admin":false},"created_at":"2018-12-02T11:46:31Z","updated_at":"2018-12-02T11:46:31Z","author_association":"CONTRIBUTOR","body":"I'm going check this today, @PEZ, thanks! \r\n\r\nLet's write a test for this and anything else you and other users can think worth it and that's not covered by the actual tests, do you have more use cases for `clj-fmt` that are not tested?"}}
{"actor":{"display_login":"pfeodrippe"}}