{"action":"created","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/249","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/249/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/249/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/249","id":109363621,"number":249,"title":"ES.78: Suggested example, enforcement","user":{"login":"Eliyahu-Ravuna","id":14928543,"avatar_url":"https://avatars.githubusercontent.com/u/14928543?v=3","gravatar_id":"","url":"https://api.github.com/users/Eliyahu-Ravuna","html_url":"https://github.com/Eliyahu-Ravuna","followers_url":"https://api.github.com/users/Eliyahu-Ravuna/followers","following_url":"https://api.github.com/users/Eliyahu-Ravuna/following{/other_user}","gists_url":"https://api.github.com/users/Eliyahu-Ravuna/gists{/gist_id}","starred_url":"https://api.github.com/users/Eliyahu-Ravuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eliyahu-Ravuna/subscriptions","organizations_url":"https://api.github.com/users/Eliyahu-Ravuna/orgs","repos_url":"https://api.github.com/users/Eliyahu-Ravuna/repos","events_url":"https://api.github.com/users/Eliyahu-Ravuna/events{/privacy}","received_events_url":"https://api.github.com/users/Eliyahu-Ravuna/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/labels/open","name":"open","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"BjarneStroustrup","id":10933044,"avatar_url":"https://avatars.githubusercontent.com/u/10933044?v=3","gravatar_id":"","url":"https://api.github.com/users/BjarneStroustrup","html_url":"https://github.com/BjarneStroustrup","followers_url":"https://api.github.com/users/BjarneStroustrup/followers","following_url":"https://api.github.com/users/BjarneStroustrup/following{/other_user}","gists_url":"https://api.github.com/users/BjarneStroustrup/gists{/gist_id}","starred_url":"https://api.github.com/users/BjarneStroustrup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BjarneStroustrup/subscriptions","organizations_url":"https://api.github.com/users/BjarneStroustrup/orgs","repos_url":"https://api.github.com/users/BjarneStroustrup/repos","events_url":"https://api.github.com/users/BjarneStroustrup/events{/privacy}","received_events_url":"https://api.github.com/users/BjarneStroustrup/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-10-01T19:10:15Z","updated_at":"2015-10-07T18:26:03Z","closed_at":null,"body":"I suggest the following text for the example and enforcement of ES.78.\r\n\r\nEliyahu Ravuna\r\n\r\n### <a name=\"Res-break\"></a> ES.78: Always end a `case` with a `break`\r\n\r\n[...]\r\n\r\n##### Example, bad\r\n\r\n    switch(eventType)\r\n    {\r\n    case Information:\r\n        update_status_bar();\r\n        break;\r\n    case Warning:\r\n        write_event_log();\r\n    case Error:\r\n        display_error_window(); //in addition to write_event_log() - bad\r\n        break;\r\n    }\r\n    \r\n##### Example, good\r\n\r\n    switch(eventType)\r\n    {\r\n    case Information:\r\n        update_status_bar();\r\n        break;\r\n    case Warning:\r\n        write_event_log();\r\n        break;\r\n    case Error:\r\n        write_event_log();\t\r\n        display_error_window(); //the intention is clear - good\r\n        break;\r\n    }\r\n\r\n[...]\r\n\r\n##### Enforcement\r\n\r\n(Simple) Every non-empty `case` should end with a `break`."},"comment":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/comments/146285235","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/249#issuecomment-146285235","issue_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/249","id":146285235,"user":{"login":"thecoshman","id":4427990,"avatar_url":"https://avatars.githubusercontent.com/u/4427990?v=3","gravatar_id":"","url":"https://api.github.com/users/thecoshman","html_url":"https://github.com/thecoshman","followers_url":"https://api.github.com/users/thecoshman/followers","following_url":"https://api.github.com/users/thecoshman/following{/other_user}","gists_url":"https://api.github.com/users/thecoshman/gists{/gist_id}","starred_url":"https://api.github.com/users/thecoshman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecoshman/subscriptions","organizations_url":"https://api.github.com/users/thecoshman/orgs","repos_url":"https://api.github.com/users/thecoshman/repos","events_url":"https://api.github.com/users/thecoshman/events{/privacy}","received_events_url":"https://api.github.com/users/thecoshman/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T18:26:03Z","updated_at":"2015-10-07T18:26:03Z","body":"I can think of valid reasons to break this rule, but I think simply having to put a comment to that effect to suppress the warning is fair enough."}}