{"action":"opened","issue":{"url":"https://api.github.com/repos/codemirror/google-modes/issues/111","repository_url":"https://api.github.com/repos/codemirror/google-modes","labels_url":"https://api.github.com/repos/codemirror/google-modes/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/codemirror/google-modes/issues/111/comments","events_url":"https://api.github.com/repos/codemirror/google-modes/issues/111/events","html_url":"https://github.com/codemirror/google-modes/issues/111","id":294978916,"number":111,"title":"[cc] indentation of ternary expressions","user":{"login":"mtaran-google","id":5050719,"avatar_url":"https://avatars0.githubusercontent.com/u/5050719?v=4","gravatar_id":"","url":"https://api.github.com/users/mtaran-google","html_url":"https://github.com/mtaran-google","followers_url":"https://api.github.com/users/mtaran-google/followers","following_url":"https://api.github.com/users/mtaran-google/following{/other_user}","gists_url":"https://api.github.com/users/mtaran-google/gists{/gist_id}","starred_url":"https://api.github.com/users/mtaran-google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtaran-google/subscriptions","organizations_url":"https://api.github.com/users/mtaran-google/orgs","repos_url":"https://api.github.com/users/mtaran-google/repos","events_url":"https://api.github.com/users/mtaran-google/events{/privacy}","received_events_url":"https://api.github.com/users/mtaran-google/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T01:53:13Z","updated_at":"2018-02-07T01:53:13Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The indentation that clang-format produces for us looks like this: (from https://github.com/abseil/abseil-cpp/blob/master/absl/types/optional.h#L405)\r\n\r\n```cpp\r\ntemplate <typename T>\r\nconstexpr copy_traits get_assign_copy_traits() {\r\n  return std::is_copy_assignable<T>::value &&\r\n                 std::is_copy_constructible<T>::value\r\n             ? copy_traits::copyable\r\n             : std::is_move_assignable<T>::value &&\r\n                       std::is_move_constructible<T>::value\r\n                   ? copy_traits::movable\r\n                   : copy_traits::non_movable;\r\n}\r\n```\r\n\r\nThere are no explicit recommendations in the style guide about ternary operator indentation, but I hope it should not be too difficult to make it do this (do a continuing +4 indent based on the start of the last expression). The logic (from the clang-format developers) is that this makes the indentation more directly correspond to syntactic structure. Sorry for not having test cases/explicit guidance on this earlier."}}
{"actor":{"display_login":"mtaran-google"}}