{"action":"created","issue":{"url":"https://api.github.com/repos/coala-analyzer/coala/issues/975","labels_url":"https://api.github.com/repos/coala-analyzer/coala/issues/975/labels{/name}","comments_url":"https://api.github.com/repos/coala-analyzer/coala/issues/975/comments","events_url":"https://api.github.com/repos/coala-analyzer/coala/issues/975/events","html_url":"https://github.com/coala-analyzer/coala/issues/975","id":109588560,"number":975,"title":"Make use of the `warnings` module","user":{"login":"Makman2","id":6023916,"avatar_url":"https://avatars.githubusercontent.com/u/6023916?v=3","gravatar_id":"","url":"https://api.github.com/users/Makman2","html_url":"https://github.com/Makman2","followers_url":"https://api.github.com/users/Makman2/followers","following_url":"https://api.github.com/users/Makman2/following{/other_user}","gists_url":"https://api.github.com/users/Makman2/gists{/gist_id}","starred_url":"https://api.github.com/users/Makman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makman2/subscriptions","organizations_url":"https://api.github.com/users/Makman2/orgs","repos_url":"https://api.github.com/users/Makman2/repos","events_url":"https://api.github.com/users/Makman2/events{/privacy}","received_events_url":"https://api.github.com/users/Makman2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/coala-analyzer/coala/labels/codestyle","name":"codestyle","color":"d4c5f9"},{"url":"https://api.github.com/repos/coala-analyzer/coala/labels/needinfo","name":"needinfo","color":"006b75"}],"state":"open","locked":false,"assignee":{"login":"fneu","id":7591685,"avatar_url":"https://avatars.githubusercontent.com/u/7591685?v=3","gravatar_id":"","url":"https://api.github.com/users/fneu","html_url":"https://github.com/fneu","followers_url":"https://api.github.com/users/fneu/followers","following_url":"https://api.github.com/users/fneu/following{/other_user}","gists_url":"https://api.github.com/users/fneu/gists{/gist_id}","starred_url":"https://api.github.com/users/fneu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fneu/subscriptions","organizations_url":"https://api.github.com/users/fneu/orgs","repos_url":"https://api.github.com/users/fneu/repos","events_url":"https://api.github.com/users/fneu/events{/privacy}","received_events_url":"https://api.github.com/users/fneu/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-10-02T23:20:01Z","updated_at":"2016-01-06T14:48:42Z","closed_at":null,"body":"This would allow to keep some components more standalone that issue warnings, because we don't need to pass a printer to them^^\r\nThe warning messages can be fetched in the coala analyzation process where they can be printed:\r\n```python\r\nimport warnings\r\n\r\nwith warnings.catch_warnings(record=True) as w:\r\n    # No panic, after exiting the context manager the previous filter value is restored.\r\n    warnings.simplefilter(\"always\")\r\n    a_task_that_can_issue_warnings(...)\r\n    # 'w' contains now all warning messages (more precise, WarningMessage objects).\r\n    # We can print them with some 'warnings' functions and redirect them to our\r\n    # logprinter inside the coala toolchain.\r\n    for warning in w:\r\n        # Sadly this won't work, we need to pass each member of `warning` to formatwarning().\r\n        log_printer.print(warnings.formatwarning(warning))\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27128557-make-use-of-the-warnings-module?utm_campaign=plugin&utm_content=tracker%2F2228228&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2228228&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/coala-analyzer/coala/issues/comments/169342696","html_url":"https://github.com/coala-analyzer/coala/issues/975#issuecomment-169342696","issue_url":"https://api.github.com/repos/coala-analyzer/coala/issues/975","id":169342696,"user":{"login":"sils1297","id":5716520,"avatar_url":"https://avatars.githubusercontent.com/u/5716520?v=3","gravatar_id":"","url":"https://api.github.com/users/sils1297","html_url":"https://github.com/sils1297","followers_url":"https://api.github.com/users/sils1297/followers","following_url":"https://api.github.com/users/sils1297/following{/other_user}","gists_url":"https://api.github.com/users/sils1297/gists{/gist_id}","starred_url":"https://api.github.com/users/sils1297/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sils1297/subscriptions","organizations_url":"https://api.github.com/users/sils1297/orgs","repos_url":"https://api.github.com/users/sils1297/repos","events_url":"https://api.github.com/users/sils1297/events{/privacy}","received_events_url":"https://api.github.com/users/sils1297/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T14:48:42Z","updated_at":"2016-01-06T14:48:42Z","body":"I personally think this would be a good thing to do. Not that I'd have time\nfor it...\n\n2016-01-06 15:46 GMT+01:00 Fabian Neuschmidt <notifications@github.com>:\n\n> It can also be integrated with the warning module!\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/coala-analyzer/coala/issues/975#issuecomment-169341973>\n> .\n>\n"}}