{"action":"created","comment":{"url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/comments/28102345","id":28102345,"diff_hunk":"@@ -0,0 +1,154 @@\n+from __future__ import absolute_import\n+\n+import contextlib\n+\n+try:\n+    import sphinx  # noqa\n+\n+    from sphinx.domains import c as c_domain\n+    from sphinx.domains import cpp as cpp_domain\n+    from sphinx.domains import javascript as javascript_domain\n+    from sphinx.domains import python as python_domain\n+    from sphinx.domains import std as std_domain\n+\n+    SPHINX_AVAILABLE = True\n+except ImportError:\n+    SPHINX_AVAILABLE = False\n+\n+from docutils.parsers import rst\n+from docutils.parsers.rst import directives as rst_directives\n+from docutils.parsers.rst import roles as rst_roles\n+\n+# Default and/or base roles/directives to ignore.\n+_base_sp_roles = tuple(['ctype'])\n+_base_sp_directives = tuple(['autosummary',\n+                             'centered', 'currentmodule', 'deprecated',\n+                             'hlist', 'include', 'index',\n+                             'literalinclude', 'no-code-block',\n+                             'seealso', 'toctree', 'todo',\n+                             'versionadded', 'versionchanged'])\n+\n+\n+class _IgnoredDirective(rst.Directive):\n+    \"\"\"Stub for unknown directives.\n+\n+    See: https://github.com/myint/rstcheck/blob/master/rstcheck.py#L305\n+    \"\"\"\n+    has_content = True\n+\n+    def run(self):\n+        return []\n+\n+\n+def _ignore_role(name, rawtext, text, lineno, inliner,\n+                 options=None, content=None):\n+    \"\"\"Stub for unknown roles.\n+\n+    See: https://github.com/myint/rstcheck/blob/master/rstcheck.py#L316\n+    \"\"\"\n+    return ([], [])","path":"restructuredtext_lint/sphinx.py","position":49,"original_position":49,"commit_id":"be210ddf999abeb6135ae070abbdbdebcf5770a9","original_commit_id":"be210ddf999abeb6135ae070abbdbdebcf5770a9","user":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"body":"Same request for linking to docutils source code","created_at":"2015-04-09T21:02:23Z","updated_at":"2015-04-09T21:02:23Z","html_url":"https://github.com/twolfson/restructuredtext-lint/pull/14#discussion_r28102345","pull_request_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/comments/28102345"},"html":{"href":"https://github.com/twolfson/restructuredtext-lint/pull/14#discussion_r28102345"},"pull_request":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14","id":32980253,"html_url":"https://github.com/twolfson/restructuredtext-lint/pull/14","diff_url":"https://github.com/twolfson/restructuredtext-lint/pull/14.diff","patch_url":"https://github.com/twolfson/restructuredtext-lint/pull/14.patch","issue_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/14","number":14,"state":"open","locked":false,"title":"Allow optionally ignoring sphinx directives/roles","user":{"login":"harlowja","id":970458,"avatar_url":"https://avatars.githubusercontent.com/u/970458?v=3","gravatar_id":"","url":"https://api.github.com/users/harlowja","html_url":"https://github.com/harlowja","followers_url":"https://api.github.com/users/harlowja/followers","following_url":"https://api.github.com/users/harlowja/following{/other_user}","gists_url":"https://api.github.com/users/harlowja/gists{/gist_id}","starred_url":"https://api.github.com/users/harlowja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harlowja/subscriptions","organizations_url":"https://api.github.com/users/harlowja/orgs","repos_url":"https://api.github.com/users/harlowja/repos","events_url":"https://api.github.com/users/harlowja/events{/privacy}","received_events_url":"https://api.github.com/users/harlowja/received_events","type":"User","site_admin":false},"body":"Sphinx roles can create false alarms and false errors\r\nif we do not ignore them, so this adds the ability to ignore\r\nthem (and turns it on by default).\r\n\r\nDo note that when enabled this module will patch ignore\r\ndirectives and roles into the sphinx code-base and then make\r\nan attempt to remove them when it has finished (this is inherently\r\nnot thread-safe).\r\n\r\nFixes issue #11 ","created_at":"2015-04-09T18:00:22Z","updated_at":"2015-04-09T21:02:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"893358e6ed99dff5b0621d2a519a373f37b5eada","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14/commits","review_comments_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14/comments","review_comment_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/14/comments","statuses_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/statuses/be210ddf999abeb6135ae070abbdbdebcf5770a9","head":{"label":"harlowja:ignore-sphinx","ref":"ignore-sphinx","sha":"be210ddf999abeb6135ae070abbdbdebcf5770a9","user":{"login":"harlowja","id":970458,"avatar_url":"https://avatars.githubusercontent.com/u/970458?v=3","gravatar_id":"","url":"https://api.github.com/users/harlowja","html_url":"https://github.com/harlowja","followers_url":"https://api.github.com/users/harlowja/followers","following_url":"https://api.github.com/users/harlowja/following{/other_user}","gists_url":"https://api.github.com/users/harlowja/gists{/gist_id}","starred_url":"https://api.github.com/users/harlowja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harlowja/subscriptions","organizations_url":"https://api.github.com/users/harlowja/orgs","repos_url":"https://api.github.com/users/harlowja/repos","events_url":"https://api.github.com/users/harlowja/events{/privacy}","received_events_url":"https://api.github.com/users/harlowja/received_events","type":"User","site_admin":false},"repo":{"id":33681026,"name":"restructuredtext-lint","full_name":"harlowja/restructuredtext-lint","owner":{"login":"harlowja","id":970458,"avatar_url":"https://avatars.githubusercontent.com/u/970458?v=3","gravatar_id":"","url":"https://api.github.com/users/harlowja","html_url":"https://github.com/harlowja","followers_url":"https://api.github.com/users/harlowja/followers","following_url":"https://api.github.com/users/harlowja/following{/other_user}","gists_url":"https://api.github.com/users/harlowja/gists{/gist_id}","starred_url":"https://api.github.com/users/harlowja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harlowja/subscriptions","organizations_url":"https://api.github.com/users/harlowja/orgs","repos_url":"https://api.github.com/users/harlowja/repos","events_url":"https://api.github.com/users/harlowja/events{/privacy}","received_events_url":"https://api.github.com/users/harlowja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harlowja/restructuredtext-lint","description":"reStructuredText linter","fork":true,"url":"https://api.github.com/repos/harlowja/restructuredtext-lint","forks_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/forks","keys_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/teams","hooks_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/hooks","issue_events_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/issues/events{/number}","events_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/events","assignees_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/assignees{/user}","branches_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/branches{/branch}","tags_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/tags","blobs_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/git/refs{/sha}","trees_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/statuses/{sha}","languages_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/languages","stargazers_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/stargazers","contributors_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/contributors","subscribers_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/subscribers","subscription_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/subscription","commits_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/commits{/sha}","git_commits_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/git/commits{/sha}","comments_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/comments{/number}","issue_comment_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/issues/comments{/number}","contents_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/contents/{+path}","compare_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/merges","archive_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/downloads","issues_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/issues{/number}","pulls_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/pulls{/number}","milestones_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/milestones{/number}","notifications_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/labels{/name}","releases_url":"https://api.github.com/repos/harlowja/restructuredtext-lint/releases{/id}","created_at":"2015-04-09T16:52:08Z","updated_at":"2015-04-09T16:52:08Z","pushed_at":"2015-04-09T19:35:17Z","git_url":"git://github.com/harlowja/restructuredtext-lint.git","ssh_url":"git@github.com:harlowja/restructuredtext-lint.git","clone_url":"https://github.com/harlowja/restructuredtext-lint.git","svn_url":"https://github.com/harlowja/restructuredtext-lint","homepage":"","size":140,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"twolfson:master","ref":"master","sha":"fc050d5ca315cc251f4d1a143715287f88a077d1","user":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"repo":{"id":14612476,"name":"restructuredtext-lint","full_name":"twolfson/restructuredtext-lint","owner":{"login":"twolfson","id":902488,"avatar_url":"https://avatars.githubusercontent.com/u/902488?v=3","gravatar_id":"","url":"https://api.github.com/users/twolfson","html_url":"https://github.com/twolfson","followers_url":"https://api.github.com/users/twolfson/followers","following_url":"https://api.github.com/users/twolfson/following{/other_user}","gists_url":"https://api.github.com/users/twolfson/gists{/gist_id}","starred_url":"https://api.github.com/users/twolfson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twolfson/subscriptions","organizations_url":"https://api.github.com/users/twolfson/orgs","repos_url":"https://api.github.com/users/twolfson/repos","events_url":"https://api.github.com/users/twolfson/events{/privacy}","received_events_url":"https://api.github.com/users/twolfson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twolfson/restructuredtext-lint","description":"reStructuredText linter","fork":false,"url":"https://api.github.com/repos/twolfson/restructuredtext-lint","forks_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/forks","keys_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/teams","hooks_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/hooks","issue_events_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/events{/number}","events_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/events","assignees_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/assignees{/user}","branches_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/branches{/branch}","tags_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/tags","blobs_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/git/refs{/sha}","trees_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/statuses/{sha}","languages_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/languages","stargazers_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/stargazers","contributors_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/contributors","subscribers_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/subscribers","subscription_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/subscription","commits_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/commits{/sha}","git_commits_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/git/commits{/sha}","comments_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/comments{/number}","issue_comment_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/comments{/number}","contents_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/contents/{+path}","compare_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/merges","archive_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/downloads","issues_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues{/number}","pulls_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls{/number}","milestones_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/milestones{/number}","notifications_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/labels{/name}","releases_url":"https://api.github.com/repos/twolfson/restructuredtext-lint/releases{/id}","created_at":"2013-11-22T08:26:58Z","updated_at":"2015-04-07T20:35:53Z","pushed_at":"2015-04-09T19:35:19Z","git_url":"git://github.com/twolfson/restructuredtext-lint.git","ssh_url":"git@github.com:twolfson/restructuredtext-lint.git","clone_url":"https://github.com/twolfson/restructuredtext-lint.git","svn_url":"https://github.com/twolfson/restructuredtext-lint","homepage":"","size":509,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14"},"html":{"href":"https://github.com/twolfson/restructuredtext-lint/pull/14"},"issue":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/14"},"comments":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/twolfson/restructuredtext-lint/statuses/be210ddf999abeb6135ae070abbdbdebcf5770a9"}}}}