{"action":"created","issue":{"url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/37","repository_url":"https://api.github.com/repos/nicklockwood/SwiftFormat","labels_url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/37/comments","events_url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/37/events","html_url":"https://github.com/nicklockwood/SwiftFormat/issues/37","id":181032219,"number":37,"title":"Multi-line guard statement indentation","user":{"login":"tonyarnold","id":4802,"avatar_url":"https://avatars.githubusercontent.com/u/4802?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyarnold","html_url":"https://github.com/tonyarnold","followers_url":"https://api.github.com/users/tonyarnold/followers","following_url":"https://api.github.com/users/tonyarnold/following{/other_user}","gists_url":"https://api.github.com/users/tonyarnold/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyarnold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyarnold/subscriptions","organizations_url":"https://api.github.com/users/tonyarnold/orgs","repos_url":"https://api.github.com/users/tonyarnold/repos","events_url":"https://api.github.com/users/tonyarnold/events{/privacy}","received_events_url":"https://api.github.com/users/tonyarnold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-10-04T23:40:53Z","updated_at":"2016-10-06T14:19:20Z","closed_at":null,"body":"This one might require bike shedding. I'm not 100% sure what the general convention is for this, but I prefer to split my guard statements up over a number of lines.\r\n\r\nCurrent SwiftFormat will do this:\r\n\r\n```swift\r\nguard\r\n     let nextFocusedIndexPath = context.nextFocusedIndexPath,\r\n     nextFocusedIndexPath != context.previouslyFocusedIndexPath\r\n     else {\r\n     return\r\n}\r\n```\r\n\r\nWhereas I would prefer that it outdent the `else` to align with the `guard` start (much like an `if…else` control statement):\r\n\r\n```swift\r\nguard\r\n     let nextFocusedIndexPath = context.nextFocusedIndexPath,\r\n     nextFocusedIndexPath != context.previouslyFocusedIndexPath\r\nelse {\r\n     return\r\n}\r\n```\r\n\r\nIn my eyes, that's easier to read, but I understand that's a personal preference.\r\n"},"comment":{"url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/comments/251976308","html_url":"https://github.com/nicklockwood/SwiftFormat/issues/37#issuecomment-251976308","issue_url":"https://api.github.com/repos/nicklockwood/SwiftFormat/issues/37","id":251976308,"user":{"login":"nicklockwood","id":546885,"avatar_url":"https://avatars.githubusercontent.com/u/546885?v=3","gravatar_id":"","url":"https://api.github.com/users/nicklockwood","html_url":"https://github.com/nicklockwood","followers_url":"https://api.github.com/users/nicklockwood/followers","following_url":"https://api.github.com/users/nicklockwood/following{/other_user}","gists_url":"https://api.github.com/users/nicklockwood/gists{/gist_id}","starred_url":"https://api.github.com/users/nicklockwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicklockwood/subscriptions","organizations_url":"https://api.github.com/users/nicklockwood/orgs","repos_url":"https://api.github.com/users/nicklockwood/repos","events_url":"https://api.github.com/users/nicklockwood/events{/privacy}","received_events_url":"https://api.github.com/users/nicklockwood/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T14:19:20Z","updated_at":"2016-10-06T14:19:20Z","body":"Should be straightforward to implement, but it would need to be optional (defaulting to current behavior)."}}
{"actor":{"display_login":"nicklockwood"}}