{"action":"created","issue":{"url":"https://api.github.com/repos/GreenSteam/pep257/issues/110","labels_url":"https://api.github.com/repos/GreenSteam/pep257/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/GreenSteam/pep257/issues/110/comments","events_url":"https://api.github.com/repos/GreenSteam/pep257/issues/110/events","html_url":"https://github.com/GreenSteam/pep257/pull/110","id":58403114,"number":110,"title":"DRY in error definitions","user":{"login":"Nurdok","id":80665,"avatar_url":"https://avatars.githubusercontent.com/u/80665?v=3","gravatar_id":"","url":"https://api.github.com/users/Nurdok","html_url":"https://github.com/Nurdok","followers_url":"https://api.github.com/users/Nurdok/followers","following_url":"https://api.github.com/users/Nurdok/following{/other_user}","gists_url":"https://api.github.com/users/Nurdok/gists{/gist_id}","starred_url":"https://api.github.com/users/Nurdok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nurdok/subscriptions","organizations_url":"https://api.github.com/users/Nurdok/orgs","repos_url":"https://api.github.com/users/Nurdok/repos","events_url":"https://api.github.com/users/Nurdok/events{/privacy}","received_events_url":"https://api.github.com/users/Nurdok/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-20T20:02:35Z","updated_at":"2015-02-21T15:56:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GreenSteam/pep257/pulls/110","html_url":"https://github.com/GreenSteam/pep257/pull/110","diff_url":"https://github.com/GreenSteam/pep257/pull/110.diff","patch_url":"https://github.com/GreenSteam/pep257/pull/110.patch"},"body":"This PR does several things:\r\n\r\n* Instead of each check returning an arbitrary error, all errors are defined beforehand.\r\n* All defined errors are also put in a registry that hold them in groups (D1xx, D2xx, etc.)\r\n* Instead of explicitly putting the error description in both the docs and the code, the error code table is generated from the error registry in the script.\r\n\r\nThe reasons are:\r\n\r\n1. DRY (Don't Repeat Yourself). Having more than one location where errors are defined is... error prone :) And already I found that the error table from the docs had somewhat different error descriptions than the ones reported by the script.\r\n2. Having a list of all the possible error code, instead of defining them only when an error is found by a check, will help to implement #96, by allowing to easily compile a list of selected errors whether the user specified them by a whitelist or a blacklist.\r\n"},"comment":{"url":"https://api.github.com/repos/GreenSteam/pep257/issues/comments/75377667","html_url":"https://github.com/GreenSteam/pep257/pull/110#issuecomment-75377667","issue_url":"https://api.github.com/repos/GreenSteam/pep257/issues/110","id":75377667,"user":{"login":"Nurdok","id":80665,"avatar_url":"https://avatars.githubusercontent.com/u/80665?v=3","gravatar_id":"","url":"https://api.github.com/users/Nurdok","html_url":"https://github.com/Nurdok","followers_url":"https://api.github.com/users/Nurdok/followers","following_url":"https://api.github.com/users/Nurdok/following{/other_user}","gists_url":"https://api.github.com/users/Nurdok/gists{/gist_id}","starred_url":"https://api.github.com/users/Nurdok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nurdok/subscriptions","organizations_url":"https://api.github.com/users/Nurdok/orgs","repos_url":"https://api.github.com/users/Nurdok/repos","events_url":"https://api.github.com/users/Nurdok/events{/privacy}","received_events_url":"https://api.github.com/users/Nurdok/received_events","type":"User","site_admin":false},"created_at":"2015-02-21T15:56:35Z","updated_at":"2015-02-21T15:56:35Z","body":"@sigmavirus24 It did bother me a little, but the problem is that I need to assign the return value to a name, e.g.,\r\n\r\n    D100 = D1xx.create_error('D100', 'Missing docstring in public module')\r\n\r\nSo that `D100` will be available as a return value for its corresponding check. Defining several errors in one call will not allow this, or make this cumbersome (if the call will return a tuple of errors)."}}