{"action":"created","comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/comments/230451563","pull_request_review_id":171196920,"id":230451563,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDQ1MTU2Mw==","diff_hunk":"@@ -331,6 +336,41 @@ def parameter_mismatches(self):\n \n         return errs\n \n+    @property\n+    def pep8_violations(self):\n+        with self._file_representation() as file:\n+            application = Flake8()\n+            application.initialize([\"--doctests\", \"--quiet\"])\n+            application.run_checks([file.name])\n+            application.report()\n+            stats = application.guide.stats\n+            return [\n+                \"{} {} {}\".format(s.count, s.error_code, s.message)\n+                for s in stats.statistics_for('')\n+            ]\n+\n+    @contextmanager\n+    def _file_representation(self):","path":"scripts/validate_docstrings.py","position":30,"original_position":30,"commit_id":"9bc7f6518aaeb2b71ad11ebdbec78c7352146d58","original_commit_id":"9bc7f6518aaeb2b71ad11ebdbec78c7352146d58","user":{"login":"datapythonista","id":10058240,"node_id":"MDQ6VXNlcjEwMDU4MjQw","avatar_url":"https://avatars2.githubusercontent.com/u/10058240?v=4","gravatar_id":"","url":"https://api.github.com/users/datapythonista","html_url":"https://github.com/datapythonista","followers_url":"https://api.github.com/users/datapythonista/followers","following_url":"https://api.github.com/users/datapythonista/following{/other_user}","gists_url":"https://api.github.com/users/datapythonista/gists{/gist_id}","starred_url":"https://api.github.com/users/datapythonista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/datapythonista/subscriptions","organizations_url":"https://api.github.com/users/datapythonista/orgs","repos_url":"https://api.github.com/users/datapythonista/repos","events_url":"https://api.github.com/users/datapythonista/events{/privacy}","received_events_url":"https://api.github.com/users/datapythonista/received_events","type":"User","site_admin":false},"body":"This name is not very descriptive. I think this is the examples as temporary file, so something like `_examples_as_temp_file` seems much clearer.\r\n\r\nNot sure if it's worth having two separate methods, I'd generate the file in the method that validates pep8. But if we have two methods, I'd have this first, as this is being used by the other (`pep8_violations`).","created_at":"2018-11-02T17:32:07Z","updated_at":"2018-11-02T17:46:16Z","html_url":"https://github.com/pandas-dev/pandas/pull/23399#discussion_r230451563","pull_request_url":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/comments/230451563"},"html":{"href":"https://github.com/pandas-dev/pandas/pull/23399#discussion_r230451563"},"pull_request":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399"}}},"pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399","id":226384905,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2Mzg0OTA1","html_url":"https://github.com/pandas-dev/pandas/pull/23399","diff_url":"https://github.com/pandas-dev/pandas/pull/23399.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/23399.patch","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23399","number":23399,"state":"open","locked":false,"title":"ENH: Use flake8 to check for PEP8 violations in doctests","user":{"login":"FHaase","id":41163037,"node_id":"MDQ6VXNlcjQxMTYzMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/41163037?v=4","gravatar_id":"","url":"https://api.github.com/users/FHaase","html_url":"https://github.com/FHaase","followers_url":"https://api.github.com/users/FHaase/followers","following_url":"https://api.github.com/users/FHaase/following{/other_user}","gists_url":"https://api.github.com/users/FHaase/gists{/gist_id}","starred_url":"https://api.github.com/users/FHaase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FHaase/subscriptions","organizations_url":"https://api.github.com/users/FHaase/orgs","repos_url":"https://api.github.com/users/FHaase/repos","events_url":"https://api.github.com/users/FHaase/events{/privacy}","received_events_url":"https://api.github.com/users/FHaase/received_events","type":"User","site_admin":false},"body":"- [x] tests added \r\n- [x] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\r\n\r\nImprovement to PR #23381 regarding issue #23154 \r\n\r\nEnables `--doctests` flag, resulting in doctests being checked by flake8\r\nUses [flake8.api.legacy](http://flake8.pycqa.org/en/latest/user/python-api.html) to invoke the tests.\r\n\r\nDownsides are:\r\n* > Flake8 3.0.0 presently does not have a public, stable Python API.\r\n* provided options in `flake8.get_style_guide` don't have an effect. Thus `setup.cfg` had to be enhanced.\r\n* returns the count of each error within the complete file, not just the requested function. [Might be confusing]\r\n\r\n`python ./scripts/validate_docstrings.py pandas.read_excel`\r\n```\r\n                [...]\r\n                Parameter \"convert_float\" description should finish with \".\"\r\n        Errors in doctest sections\r\n                2 F721 syntax error in doctest\r\n                2 F821 undefined name '_make_signature'\r\n```\r\n\r\nHelp in the form of `Use \"flake8 pandas/util/_decorators.py\" for further information.` could be added to the output:\r\n```\r\npandas/util/_decorators.py:320:26: F721 syntax error in doctest\r\npandas/util/_decorators.py:321:13: F721 syntax error in doctest\r\npandas/util/_decorators.py:322:15: F821 undefined name '_make_signature'\r\npandas/util/_decorators.py:322:31: F821 undefined name 'f'\r\n```\r\n","created_at":"2018-10-28T17:51:57Z","updated_at":"2018-11-02T17:46:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbe60988d791fb6a5d2b1703ce99507fa365c782","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":134699,"node_id":"MDU6TGFiZWwxMzQ2OTk=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Docs","name":"Docs","color":"3465A4","default":false},{"id":106935113,"node_id":"MDU6TGFiZWwxMDY5MzUxMTM=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Style","name":"Style","color":"eb6420","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399/commits","review_comments_url":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399/comments","review_comment_url":"https://api.github.com/repos/pandas-dev/pandas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/23399/comments","statuses_url":"https://api.github.com/repos/pandas-dev/pandas/statuses/9bc7f6518aaeb2b71ad11ebdbec78c7352146d58","head":{"label":"FHaase:feature/validate_docstrings","ref":"feature/validate_docstrings","sha":"9bc7f6518aaeb2b71ad11ebdbec78c7352146d58","user":{"login":"FHaase","id":41163037,"node_id":"MDQ6VXNlcjQxMTYzMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/41163037?v=4","gravatar_id":"","url":"https://api.github.com/users/FHaase","html_url":"https://github.com/FHaase","followers_url":"https://api.github.com/users/FHaase/followers","following_url":"https://api.github.com/users/FHaase/following{/other_user}","gists_url":"https://api.github.com/users/FHaase/gists{/gist_id}","starred_url":"https://api.github.com/users/FHaase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FHaase/subscriptions","organizations_url":"https://api.github.com/users/FHaase/orgs","repos_url":"https://api.github.com/users/FHaase/repos","events_url":"https://api.github.com/users/FHaase/events{/privacy}","received_events_url":"https://api.github.com/users/FHaase/received_events","type":"User","site_admin":false},"repo":{"id":153504226,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM1MDQyMjY=","name":"pandas","full_name":"FHaase/pandas","private":false,"owner":{"login":"FHaase","id":41163037,"node_id":"MDQ6VXNlcjQxMTYzMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/41163037?v=4","gravatar_id":"","url":"https://api.github.com/users/FHaase","html_url":"https://github.com/FHaase","followers_url":"https://api.github.com/users/FHaase/followers","following_url":"https://api.github.com/users/FHaase/following{/other_user}","gists_url":"https://api.github.com/users/FHaase/gists{/gist_id}","starred_url":"https://api.github.com/users/FHaase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FHaase/subscriptions","organizations_url":"https://api.github.com/users/FHaase/orgs","repos_url":"https://api.github.com/users/FHaase/repos","events_url":"https://api.github.com/users/FHaase/events{/privacy}","received_events_url":"https://api.github.com/users/FHaase/received_events","type":"User","site_admin":false},"html_url":"https://github.com/FHaase/pandas","description":"Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more","fork":true,"url":"https://api.github.com/repos/FHaase/pandas","forks_url":"https://api.github.com/repos/FHaase/pandas/forks","keys_url":"https://api.github.com/repos/FHaase/pandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FHaase/pandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FHaase/pandas/teams","hooks_url":"https://api.github.com/repos/FHaase/pandas/hooks","issue_events_url":"https://api.github.com/repos/FHaase/pandas/issues/events{/number}","events_url":"https://api.github.com/repos/FHaase/pandas/events","assignees_url":"https://api.github.com/repos/FHaase/pandas/assignees{/user}","branches_url":"https://api.github.com/repos/FHaase/pandas/branches{/branch}","tags_url":"https://api.github.com/repos/FHaase/pandas/tags","blobs_url":"https://api.github.com/repos/FHaase/pandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FHaase/pandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FHaase/pandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/FHaase/pandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FHaase/pandas/statuses/{sha}","languages_url":"https://api.github.com/repos/FHaase/pandas/languages","stargazers_url":"https://api.github.com/repos/FHaase/pandas/stargazers","contributors_url":"https://api.github.com/repos/FHaase/pandas/contributors","subscribers_url":"https://api.github.com/repos/FHaase/pandas/subscribers","subscription_url":"https://api.github.com/repos/FHaase/pandas/subscription","commits_url":"https://api.github.com/repos/FHaase/pandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/FHaase/pandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/FHaase/pandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/FHaase/pandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/FHaase/pandas/contents/{+path}","compare_url":"https://api.github.com/repos/FHaase/pandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FHaase/pandas/merges","archive_url":"https://api.github.com/repos/FHaase/pandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FHaase/pandas/downloads","issues_url":"https://api.github.com/repos/FHaase/pandas/issues{/number}","pulls_url":"https://api.github.com/repos/FHaase/pandas/pulls{/number}","milestones_url":"https://api.github.com/repos/FHaase/pandas/milestones{/number}","notifications_url":"https://api.github.com/repos/FHaase/pandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FHaase/pandas/labels{/name}","releases_url":"https://api.github.com/repos/FHaase/pandas/releases{/id}","deployments_url":"https://api.github.com/repos/FHaase/pandas/deployments","created_at":"2018-10-17T18:24:16Z","updated_at":"2018-10-17T18:24:24Z","pushed_at":"2018-11-02T14:25:32Z","git_url":"git://github.com/FHaase/pandas.git","ssh_url":"git@github.com:FHaase/pandas.git","clone_url":"https://github.com/FHaase/pandas.git","svn_url":"https://github.com/FHaase/pandas","homepage":"https://pandas.pydata.org","size":133508,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pandas-dev:master","ref":"master","sha":"4f717551b8e49ecd978bb4f5a985d6f6a96d86e9","user":{"login":"pandas-dev","id":21206976,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMjA2OTc2","avatar_url":"https://avatars2.githubusercontent.com/u/21206976?v=4","gravatar_id":"","url":"https://api.github.com/users/pandas-dev","html_url":"https://github.com/pandas-dev","followers_url":"https://api.github.com/users/pandas-dev/followers","following_url":"https://api.github.com/users/pandas-dev/following{/other_user}","gists_url":"https://api.github.com/users/pandas-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pandas-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandas-dev/subscriptions","organizations_url":"https://api.github.com/users/pandas-dev/orgs","repos_url":"https://api.github.com/users/pandas-dev/repos","events_url":"https://api.github.com/users/pandas-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pandas-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":858127,"node_id":"MDEwOlJlcG9zaXRvcnk4NTgxMjc=","name":"pandas","full_name":"pandas-dev/pandas","private":false,"owner":{"login":"pandas-dev","id":21206976,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMjA2OTc2","avatar_url":"https://avatars2.githubusercontent.com/u/21206976?v=4","gravatar_id":"","url":"https://api.github.com/users/pandas-dev","html_url":"https://github.com/pandas-dev","followers_url":"https://api.github.com/users/pandas-dev/followers","following_url":"https://api.github.com/users/pandas-dev/following{/other_user}","gists_url":"https://api.github.com/users/pandas-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/pandas-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandas-dev/subscriptions","organizations_url":"https://api.github.com/users/pandas-dev/orgs","repos_url":"https://api.github.com/users/pandas-dev/repos","events_url":"https://api.github.com/users/pandas-dev/events{/privacy}","received_events_url":"https://api.github.com/users/pandas-dev/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pandas-dev/pandas","description":"Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more","fork":false,"url":"https://api.github.com/repos/pandas-dev/pandas","forks_url":"https://api.github.com/repos/pandas-dev/pandas/forks","keys_url":"https://api.github.com/repos/pandas-dev/pandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pandas-dev/pandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pandas-dev/pandas/teams","hooks_url":"https://api.github.com/repos/pandas-dev/pandas/hooks","issue_events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/events{/number}","events_url":"https://api.github.com/repos/pandas-dev/pandas/events","assignees_url":"https://api.github.com/repos/pandas-dev/pandas/assignees{/user}","branches_url":"https://api.github.com/repos/pandas-dev/pandas/branches{/branch}","tags_url":"https://api.github.com/repos/pandas-dev/pandas/tags","blobs_url":"https://api.github.com/repos/pandas-dev/pandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pandas-dev/pandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pandas-dev/pandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/pandas-dev/pandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pandas-dev/pandas/statuses/{sha}","languages_url":"https://api.github.com/repos/pandas-dev/pandas/languages","stargazers_url":"https://api.github.com/repos/pandas-dev/pandas/stargazers","contributors_url":"https://api.github.com/repos/pandas-dev/pandas/contributors","subscribers_url":"https://api.github.com/repos/pandas-dev/pandas/subscribers","subscription_url":"https://api.github.com/repos/pandas-dev/pandas/subscription","commits_url":"https://api.github.com/repos/pandas-dev/pandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/pandas-dev/pandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/pandas-dev/pandas/contents/{+path}","compare_url":"https://api.github.com/repos/pandas-dev/pandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pandas-dev/pandas/merges","archive_url":"https://api.github.com/repos/pandas-dev/pandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pandas-dev/pandas/downloads","issues_url":"https://api.github.com/repos/pandas-dev/pandas/issues{/number}","pulls_url":"https://api.github.com/repos/pandas-dev/pandas/pulls{/number}","milestones_url":"https://api.github.com/repos/pandas-dev/pandas/milestones{/number}","notifications_url":"https://api.github.com/repos/pandas-dev/pandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pandas-dev/pandas/labels{/name}","releases_url":"https://api.github.com/repos/pandas-dev/pandas/releases{/id}","deployments_url":"https://api.github.com/repos/pandas-dev/pandas/deployments","created_at":"2010-08-24T01:37:33Z","updated_at":"2018-11-02T17:15:18Z","pushed_at":"2018-11-02T17:26:52Z","git_url":"git://github.com/pandas-dev/pandas.git","ssh_url":"git@github.com:pandas-dev/pandas.git","clone_url":"https://github.com/pandas-dev/pandas.git","svn_url":"https://github.com/pandas-dev/pandas","homepage":"https://pandas.pydata.org","size":133739,"stargazers_count":16719,"watchers_count":16719,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6746,"mirror_url":null,"archived":false,"open_issues_count":2881,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":6746,"open_issues":2881,"watchers":16719,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399"},"html":{"href":"https://github.com/pandas-dev/pandas/pull/23399"},"issue":{"href":"https://api.github.com/repos/pandas-dev/pandas/issues/23399"},"comments":{"href":"https://api.github.com/repos/pandas-dev/pandas/issues/23399/comments"},"review_comments":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399/comments"},"review_comment":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pandas-dev/pandas/pulls/23399/commits"},"statuses":{"href":"https://api.github.com/repos/pandas-dev/pandas/statuses/9bc7f6518aaeb2b71ad11ebdbec78c7352146d58"}},"author_association":"NONE"}}
{"actor":{"display_login":"datapythonista"}}