{"action":"created","issue":{"url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/168","repository_url":"https://api.github.com/repos/PyCQA/pydocstyle","labels_url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/168/comments","events_url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/168/events","html_url":"https://github.com/PyCQA/pydocstyle/issues/168","id":122573628,"number":168,"title":"Invalid syntax exception not caught by pep257 runner","user":{"login":"jayvdb","id":15092,"avatar_url":"https://avatars.githubusercontent.com/u/15092?v=3","gravatar_id":"","url":"https://api.github.com/users/jayvdb","html_url":"https://github.com/jayvdb","followers_url":"https://api.github.com/users/jayvdb/followers","following_url":"https://api.github.com/users/jayvdb/following{/other_user}","gists_url":"https://api.github.com/users/jayvdb/gists{/gist_id}","starred_url":"https://api.github.com/users/jayvdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayvdb/subscriptions","organizations_url":"https://api.github.com/users/jayvdb/orgs","repos_url":"https://api.github.com/users/jayvdb/repos","events_url":"https://api.github.com/users/jayvdb/events{/privacy}","received_events_url":"https://api.github.com/users/jayvdb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/PyCQA/pydocstyle/milestones/5","html_url":"https://github.com/PyCQA/pydocstyle/milestones/pydocstyle%201.2.0","labels_url":"https://api.github.com/repos/PyCQA/pydocstyle/milestones/5/labels","id":1860894,"number":5,"title":"pydocstyle 1.2.0","description":"","creator":{"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},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-07-01T22:29:12Z","updated_at":"2016-07-01T22:29:21Z","due_on":"2016-10-01T21:00:00Z","closed_at":null},"comments":1,"created_at":"2015-12-16T18:35:44Z","updated_at":"2016-09-29T15:59:17Z","closed_at":null,"body":"When invoked directly on the command line to parse a module with invalid syntax, an exception is raised.\r\nNot a big problem when only one module is being checked, but it causes a halt if many modules are being checked.  It would be helpful for the exception to indicate which module failed, and skip it.  It is possible to determine the failing module by using `-v`, however that requires re-running the job when an exception is encountered.\r\n\r\nEach of the following are probably separate issues that can be solved by hardening the parser, but there will always be new syntax issues, and the pep257 runner should handle them more reasonably.\r\n\r\npep8 test file [E90.py](https://github.com/PyCQA/pep8/blob/fed43c5/testsuite/E90.py):\r\n```\r\npep8$ pep257 testsuite/E90.py \r\nTraceback (most recent call last):\r\n  File \"/usr/bin/pep257\", line 9, in <module>\r\n    load_entry_point('pep257==0.7.1a0', 'console_scripts', 'pep257')()\r\n  File \"/.../pep257.py\", line 1642, in main\r\n    sys.exit(run_pep257())\r\n  File \"/.../pep257.py\", line 1300, in run_pep257\r\n    errors.extend(check((filename,), select=checked_codes))\r\n  File \"/.../pep257.py\", line 1241, in check\r\n    for error in PEP257Checker().check_source(source, filename):\r\n  File \"/.../pep257.py\", line 1338, in check_source\r\n    module = parse(StringIO(source), filename)\r\n  File \"/.../pep257.py\", line 276, in __call__\r\n    return self.parse_module()\r\n  File \"/.../pep257.py\", line 428, in parse_module\r\n    children = list(self.parse_definitions(Module, all=True))\r\n  File \"/.../pep257.py\", line 370, in parse_definitions\r\n    for definition in self.parse_definitions(class_):\r\n  File \"/.../pep257.py\", line 370, in parse_definitions\r\n    for definition in self.parse_definitions(class_):\r\n  File \"/.../pep257.py\", line 378, in parse_definitions\r\n    self.stream.move()\r\n  File \"/.../pep257.py\", line 241, in move\r\n    current = next(self._generator, None)\r\n  File \"/usr/lib64/python2.7/tokenize.py\", line 357, in generate_tokens\r\n    (\"<tokenize>\", lnum, pos, line))\r\n  File \"<tokenize>\", line 9\r\n    except:\r\n    ^\r\nIndentationError: unindent does not match any outer indentation level\r\n```\r\n\r\nAnother one:\r\n\r\nhttps://bitbucket.org/blais/snakefood/src/fa88cf9c38275362f13b208d1a7d88c4d4ab9313/test/data/simple/invalid.py\r\n\r\n```\r\nsnakefood$ pep257 test/data/simple/invalid.py \r\nTraceback (most recent call last):\r\n  File \"/usr/bin/pep257\", line 9, in <module>\r\n    load_entry_point('pep257==0.7.1a0', 'console_scripts', 'pep257')()\r\n  File \"/.../pep257.py\", line 1640, in main\r\n    sys.exit(run_pep257())\r\n  File \"/.../pep257.py\", line 1298, in run_pep257\r\n    errors.extend(check((filename,), select=checked_codes))\r\n  File \"/.../pep257.py\", line 1239, in check\r\n    for error in PEP257Checker().check_source(source, filename):\r\n  File \"/.../pep257.py\", line 1336, in check_source\r\n    module = parse(StringIO(source), filename)\r\n  File \"/.../pep257.py\", line 276, in __call__\r\n    return self.parse_module()\r\n  File \"/.../pep257.py\", line 428, in parse_module\r\n    children = list(self.parse_definitions(Module, all=True))\r\n  File \"/.../pep257.py\", line 367, in parse_definitions\r\n    yield self.parse_definition(class_._nest(self.current.value))\r\n  File \"/.../pep257.py\", line 466, in parse_definition\r\n    assert self.current.kind != tk.INDENT\r\nAttributeError: 'NoneType' object has no attribute 'kind'\r\n```\r\n\r\nAnother one is running pep257 on Python 2 with code containing matmul ; e.g. [cpython Lib/unittest/test/testmock/testmagicmethods.py](https://hg.python.org/cpython/file/99582/Lib/unittest/test/testmock/testmagicmethods.py#l429)\r\n\r\n```\r\ncpython$ pep257 Lib/unittest/test/testmock/testmagicmethods.py \r\nChecking file Lib/unittest/test/testmock/testmagicmethods.py.\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/pep257\", line 9, in <module>\r\n    load_entry_point('pep257==0.7.1a0', 'console_scripts', 'pep257')()\r\n  File \"/.../pep257.py\", line 1642, in main\r\n    sys.exit(run_pep257())\r\n  File \"/.../pep257.py\", line 1300, in run_pep257\r\n    errors.extend(check((filename,), select=checked_codes))\r\n  File \"/.../pep257.py\", line 1241, in check\r\n    for error in PEP257Checker().check_source(source, filename):\r\n  File \"/.../pep257.py\", line 1338, in check_source\r\n    module = parse(StringIO(source), filename)\r\n  File \"/.../pep257.py\", line 276, in __call__\r\n    return self.parse_module()\r\n  File \"/.../pep257.py\", line 428, in parse_module\r\n    children = list(self.parse_definitions(Module, all=True))\r\n  File \"/.../pep257.py\", line 367, in parse_definitions\r\n    yield self.parse_definition(class_._nest(self.current.value))\r\n  File \"/.../pep257.py\", line 487, in parse_definition\r\n    self.current.kind,\r\nAttributeError: 'NoneType' object has no attribute 'kind'\r\n```"},"comment":{"url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/comments/250509698","html_url":"https://github.com/PyCQA/pydocstyle/issues/168#issuecomment-250509698","issue_url":"https://api.github.com/repos/PyCQA/pydocstyle/issues/168","id":250509698,"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":"2016-09-29T15:59:17Z","updated_at":"2016-09-29T15:59:17Z","body":"`pydocstyle` should continue parsing other files while emitting a warning."}}
{"actor":{"display_login":"Nurdok"}}