{"action":"created","issue":{"url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/687","repository_url":"https://api.github.com/repos/dlang-community/D-Scanner","labels_url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/687/comments","events_url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/687/events","html_url":"https://github.com/dlang-community/D-Scanner/issues/687","id":352874615,"node_id":"MDU6SXNzdWUzNTI4NzQ2MTU=","number":687,"title":"Add unique error and warning labels","user":{"login":"Voultapher","id":6864584,"node_id":"MDQ6VXNlcjY4NjQ1ODQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6864584?v=4","gravatar_id":"","url":"https://api.github.com/users/Voultapher","html_url":"https://github.com/Voultapher","followers_url":"https://api.github.com/users/Voultapher/followers","following_url":"https://api.github.com/users/Voultapher/following{/other_user}","gists_url":"https://api.github.com/users/Voultapher/gists{/gist_id}","starred_url":"https://api.github.com/users/Voultapher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Voultapher/subscriptions","organizations_url":"https://api.github.com/users/Voultapher/orgs","repos_url":"https://api.github.com/users/Voultapher/repos","events_url":"https://api.github.com/users/Voultapher/events{/privacy}","received_events_url":"https://api.github.com/users/Voultapher/received_events","type":"User","site_admin":false},"labels":[{"id":3613502,"node_id":"MDU6TGFiZWwzNjEzNTAy","url":"https://api.github.com/repos/dlang-community/D-Scanner/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-22T09:34:12Z","updated_at":"2018-08-22T10:08:41Z","closed_at":null,"author_association":"NONE","body":"Right now when running dscanner it reports something like this:\r\n```\r\nmain.d(6:25)[warn]: Public declaration 'fill_linear_n' is undocumented.\r\nmain.d(10:14)[warn]: Variable `i` initializer is useless because it does not differ from the default value\r\nmain.d(18:8)[warn]: Public declaration 'fill_linear_n_lookup_one' is undocumented.\r\n```\r\nWarning 1 and 3 are fairly straight forward, and I can address them by searching `dlang function documentation`. Yet the second warning leaves me hanging telling me what is wrong, yet I have no idea how to fix it, because searching for it is not conclusive.\r\n\r\nTo help with this issue most linters I know employ a form of short unique label for each error and warning.\r\n\r\nEither with an abstract symbol like: `E112` or `W601`\r\nExamples:\r\n- [pycodestlye](http://pycodestyle.pycqa.org/en/latest/intro.html#error-codes)\r\n- [pyflakes](https://lintlyci.github.io/Flake8Rules/)\r\n\r\nAnother popular option is to use a short unique description like: `no-duplicate-case` or `borrowed_box`\r\nExamples:\r\n- [eslint](https://eslint.org/docs/rules/)\r\n- [clippy](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)\r\n\r\nIdeally there is an overview page like in the examples that is SEO optimized and that holds both explanation and possible resolution.\r\n\r\nSearching for `dscanner W226` or `dscanner no-duplicate-case` is **much** easier and more likely to lead to the place explaining the rule and how to fix code affected by it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/comments/414982224","html_url":"https://github.com/dlang-community/D-Scanner/issues/687#issuecomment-414982224","issue_url":"https://api.github.com/repos/dlang-community/D-Scanner/issues/687","id":414982224,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDk4MjIyNA==","user":{"login":"wilzbach","id":4370550,"node_id":"MDQ6VXNlcjQzNzA1NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T10:08:41Z","updated_at":"2018-08-22T10:08:41Z","author_association":"MEMBER","body":"I think the two points to take away here are:\r\n- use errors codes (I really like shellcheck's wiki, e.g. https://github.com/koalaman/shellcheck/wiki/SC1004)\r\n- don't activate the \"useless initializer\" check by default (as it's a very subjective choice and not recommended/activated for DMD/Phobos either)\r\n\r\n> discouraging an explicit initialisier is questionable imo\r\n\r\nFWIW the check is only when you initialize to the default value. Floating point types have NaN as default init value, so the explicit initializer isn't explicit at the tour, but required."}}
{"actor":{"display_login":"wilzbach"}}