{"action":"closed","number":8,"pull_request":{"url":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8","id":67133747,"html_url":"https://github.com/azu/textlint-rule-prh/pull/8","diff_url":"https://github.com/azu/textlint-rule-prh/pull/8.diff","patch_url":"https://github.com/azu/textlint-rule-prh/pull/8.patch","issue_url":"https://api.github.com/repos/azu/textlint-rule-prh/issues/8","number":8,"state":"closed","locked":false,"title":"Report error correctly when pattern starts with expected value","user":{"login":"orangain","id":532251,"avatar_url":"https://avatars.githubusercontent.com/u/532251?v=3","gravatar_id":"","url":"https://api.github.com/users/orangain","html_url":"https://github.com/orangain","followers_url":"https://api.github.com/users/orangain/followers","following_url":"https://api.github.com/users/orangain/following{/other_user}","gists_url":"https://api.github.com/users/orangain/gists{/gist_id}","starred_url":"https://api.github.com/users/orangain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangain/subscriptions","organizations_url":"https://api.github.com/users/orangain/orgs","repos_url":"https://api.github.com/users/orangain/repos","events_url":"https://api.github.com/users/orangain/events{/privacy}","received_events_url":"https://api.github.com/users/orangain/received_events","type":"User","site_admin":false},"body":"## Problem\r\n\r\ntextlint-rule-prh does not report an error with a text `\"（図1） \"` and the following rule:\r\n\r\n```yml\r\n  # 全角括弧前後の空白を除去\r\n  - expected: ）\r\n    pattern: /） | ）/\r\n```\r\n\r\nNote: prh does fix the error with this rule.\r\n\r\n## Cause\r\n\r\nThis is because the [following condition](https://github.com/azu/textlint-rule-prh/blob/0f1243fc3268df6c7bfefe4070f599133b9539cc/src/prh-rule.js#L81) incorrectly ignore the error.\r\n\r\n```js\r\n               // Avoid accidental match(ignore case, expected contain actual pattern)\r\n               if (slicedText.indexOf(expected) === 0) {\r\n                   return;\r\n               }\r\n```\r\n\r\nIn this case, variables have the following values.\r\n\r\n* `slicedText`:  `'） '`\r\n* `matchedText`: `'） '`\r\n* `expected`:    `'）'`\r\n\r\nI understand that the condition is introduced by https://github.com/azu/textlint-rule-prh/commit/f528e780567b4cf1584182d773f3b2d499c5ac6f and https://github.com/azu/textlint-rule-prh/commit/cd739dc232e4108430bc2009a9fbb690e3dcbd88 to fix `s/Web/Web/i` problem and `s/ベンダ/ベンダー/` problem. But prh itself does not handle `s/ベンダ/ベンダー/` problem, i.e. prh corrects `ベンダー` to `ベンダーー`. So, I think `s/ベンダ/ベンダー/` problem should be handled by rule (or changing prh's behavior). I believe incompatibility between prh and textlint-rule-prh is confusing.\r\n\r\n## Implementation\r\n\r\n* Handle only `s/Web/Web/i` problem by code.\r\n* Handle `s/ベンダ/ベンダー/` problem by rule.\r\n\r\nThis fix the `s/） /）/` problem.\r\n\r\nI'll send another PR to [web+db_press.yml](https://github.com/azu/textlint-rule-web-plus-db/blob/master/dict/web%2Bdb_press.yml) to fix some patterns if this one is merged.","created_at":"2016-04-20T06:18:08Z","updated_at":"2016-04-20T06:50:32Z","closed_at":"2016-04-20T06:50:32Z","merged_at":"2016-04-20T06:50:32Z","merge_commit_sha":"93e17adb93dfb8444befbeccd85d4bdf61ccf12e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8/commits","review_comments_url":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8/comments","review_comment_url":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azu/textlint-rule-prh/issues/8/comments","statuses_url":"https://api.github.com/repos/azu/textlint-rule-prh/statuses/ee0c484b8134a95a32006c2b78fb9b351cad9c77","head":{"label":"orangain:fix-not-reported-issue","ref":"fix-not-reported-issue","sha":"ee0c484b8134a95a32006c2b78fb9b351cad9c77","user":{"login":"orangain","id":532251,"avatar_url":"https://avatars.githubusercontent.com/u/532251?v=3","gravatar_id":"","url":"https://api.github.com/users/orangain","html_url":"https://github.com/orangain","followers_url":"https://api.github.com/users/orangain/followers","following_url":"https://api.github.com/users/orangain/following{/other_user}","gists_url":"https://api.github.com/users/orangain/gists{/gist_id}","starred_url":"https://api.github.com/users/orangain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangain/subscriptions","organizations_url":"https://api.github.com/users/orangain/orgs","repos_url":"https://api.github.com/users/orangain/repos","events_url":"https://api.github.com/users/orangain/events{/privacy}","received_events_url":"https://api.github.com/users/orangain/received_events","type":"User","site_admin":false},"repo":{"id":56653579,"name":"textlint-rule-prh","full_name":"orangain/textlint-rule-prh","owner":{"login":"orangain","id":532251,"avatar_url":"https://avatars.githubusercontent.com/u/532251?v=3","gravatar_id":"","url":"https://api.github.com/users/orangain","html_url":"https://github.com/orangain","followers_url":"https://api.github.com/users/orangain/followers","following_url":"https://api.github.com/users/orangain/following{/other_user}","gists_url":"https://api.github.com/users/orangain/gists{/gist_id}","starred_url":"https://api.github.com/users/orangain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangain/subscriptions","organizations_url":"https://api.github.com/users/orangain/orgs","repos_url":"https://api.github.com/users/orangain/repos","events_url":"https://api.github.com/users/orangain/events{/privacy}","received_events_url":"https://api.github.com/users/orangain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/orangain/textlint-rule-prh","description":"textlint rule for prh.","fork":true,"url":"https://api.github.com/repos/orangain/textlint-rule-prh","forks_url":"https://api.github.com/repos/orangain/textlint-rule-prh/forks","keys_url":"https://api.github.com/repos/orangain/textlint-rule-prh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orangain/textlint-rule-prh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orangain/textlint-rule-prh/teams","hooks_url":"https://api.github.com/repos/orangain/textlint-rule-prh/hooks","issue_events_url":"https://api.github.com/repos/orangain/textlint-rule-prh/issues/events{/number}","events_url":"https://api.github.com/repos/orangain/textlint-rule-prh/events","assignees_url":"https://api.github.com/repos/orangain/textlint-rule-prh/assignees{/user}","branches_url":"https://api.github.com/repos/orangain/textlint-rule-prh/branches{/branch}","tags_url":"https://api.github.com/repos/orangain/textlint-rule-prh/tags","blobs_url":"https://api.github.com/repos/orangain/textlint-rule-prh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orangain/textlint-rule-prh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orangain/textlint-rule-prh/git/refs{/sha}","trees_url":"https://api.github.com/repos/orangain/textlint-rule-prh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orangain/textlint-rule-prh/statuses/{sha}","languages_url":"https://api.github.com/repos/orangain/textlint-rule-prh/languages","stargazers_url":"https://api.github.com/repos/orangain/textlint-rule-prh/stargazers","contributors_url":"https://api.github.com/repos/orangain/textlint-rule-prh/contributors","subscribers_url":"https://api.github.com/repos/orangain/textlint-rule-prh/subscribers","subscription_url":"https://api.github.com/repos/orangain/textlint-rule-prh/subscription","commits_url":"https://api.github.com/repos/orangain/textlint-rule-prh/commits{/sha}","git_commits_url":"https://api.github.com/repos/orangain/textlint-rule-prh/git/commits{/sha}","comments_url":"https://api.github.com/repos/orangain/textlint-rule-prh/comments{/number}","issue_comment_url":"https://api.github.com/repos/orangain/textlint-rule-prh/issues/comments{/number}","contents_url":"https://api.github.com/repos/orangain/textlint-rule-prh/contents/{+path}","compare_url":"https://api.github.com/repos/orangain/textlint-rule-prh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orangain/textlint-rule-prh/merges","archive_url":"https://api.github.com/repos/orangain/textlint-rule-prh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orangain/textlint-rule-prh/downloads","issues_url":"https://api.github.com/repos/orangain/textlint-rule-prh/issues{/number}","pulls_url":"https://api.github.com/repos/orangain/textlint-rule-prh/pulls{/number}","milestones_url":"https://api.github.com/repos/orangain/textlint-rule-prh/milestones{/number}","notifications_url":"https://api.github.com/repos/orangain/textlint-rule-prh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orangain/textlint-rule-prh/labels{/name}","releases_url":"https://api.github.com/repos/orangain/textlint-rule-prh/releases{/id}","deployments_url":"https://api.github.com/repos/orangain/textlint-rule-prh/deployments","created_at":"2016-04-20T03:51:11Z","updated_at":"2016-04-20T03:51:11Z","pushed_at":"2016-04-20T05:54:49Z","git_url":"git://github.com/orangain/textlint-rule-prh.git","ssh_url":"git@github.com:orangain/textlint-rule-prh.git","clone_url":"https://github.com/orangain/textlint-rule-prh.git","svn_url":"https://github.com/orangain/textlint-rule-prh","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"azu:master","ref":"master","sha":"0f1243fc3268df6c7bfefe4070f599133b9539cc","user":{"login":"azu","id":19714,"avatar_url":"https://avatars.githubusercontent.com/u/19714?v=3","gravatar_id":"","url":"https://api.github.com/users/azu","html_url":"https://github.com/azu","followers_url":"https://api.github.com/users/azu/followers","following_url":"https://api.github.com/users/azu/following{/other_user}","gists_url":"https://api.github.com/users/azu/gists{/gist_id}","starred_url":"https://api.github.com/users/azu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azu/subscriptions","organizations_url":"https://api.github.com/users/azu/orgs","repos_url":"https://api.github.com/users/azu/repos","events_url":"https://api.github.com/users/azu/events{/privacy}","received_events_url":"https://api.github.com/users/azu/received_events","type":"User","site_admin":false},"repo":{"id":42363098,"name":"textlint-rule-prh","full_name":"azu/textlint-rule-prh","owner":{"login":"azu","id":19714,"avatar_url":"https://avatars.githubusercontent.com/u/19714?v=3","gravatar_id":"","url":"https://api.github.com/users/azu","html_url":"https://github.com/azu","followers_url":"https://api.github.com/users/azu/followers","following_url":"https://api.github.com/users/azu/following{/other_user}","gists_url":"https://api.github.com/users/azu/gists{/gist_id}","starred_url":"https://api.github.com/users/azu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azu/subscriptions","organizations_url":"https://api.github.com/users/azu/orgs","repos_url":"https://api.github.com/users/azu/repos","events_url":"https://api.github.com/users/azu/events{/privacy}","received_events_url":"https://api.github.com/users/azu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azu/textlint-rule-prh","description":"textlint rule for prh.","fork":false,"url":"https://api.github.com/repos/azu/textlint-rule-prh","forks_url":"https://api.github.com/repos/azu/textlint-rule-prh/forks","keys_url":"https://api.github.com/repos/azu/textlint-rule-prh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azu/textlint-rule-prh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azu/textlint-rule-prh/teams","hooks_url":"https://api.github.com/repos/azu/textlint-rule-prh/hooks","issue_events_url":"https://api.github.com/repos/azu/textlint-rule-prh/issues/events{/number}","events_url":"https://api.github.com/repos/azu/textlint-rule-prh/events","assignees_url":"https://api.github.com/repos/azu/textlint-rule-prh/assignees{/user}","branches_url":"https://api.github.com/repos/azu/textlint-rule-prh/branches{/branch}","tags_url":"https://api.github.com/repos/azu/textlint-rule-prh/tags","blobs_url":"https://api.github.com/repos/azu/textlint-rule-prh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azu/textlint-rule-prh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azu/textlint-rule-prh/git/refs{/sha}","trees_url":"https://api.github.com/repos/azu/textlint-rule-prh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azu/textlint-rule-prh/statuses/{sha}","languages_url":"https://api.github.com/repos/azu/textlint-rule-prh/languages","stargazers_url":"https://api.github.com/repos/azu/textlint-rule-prh/stargazers","contributors_url":"https://api.github.com/repos/azu/textlint-rule-prh/contributors","subscribers_url":"https://api.github.com/repos/azu/textlint-rule-prh/subscribers","subscription_url":"https://api.github.com/repos/azu/textlint-rule-prh/subscription","commits_url":"https://api.github.com/repos/azu/textlint-rule-prh/commits{/sha}","git_commits_url":"https://api.github.com/repos/azu/textlint-rule-prh/git/commits{/sha}","comments_url":"https://api.github.com/repos/azu/textlint-rule-prh/comments{/number}","issue_comment_url":"https://api.github.com/repos/azu/textlint-rule-prh/issues/comments{/number}","contents_url":"https://api.github.com/repos/azu/textlint-rule-prh/contents/{+path}","compare_url":"https://api.github.com/repos/azu/textlint-rule-prh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azu/textlint-rule-prh/merges","archive_url":"https://api.github.com/repos/azu/textlint-rule-prh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azu/textlint-rule-prh/downloads","issues_url":"https://api.github.com/repos/azu/textlint-rule-prh/issues{/number}","pulls_url":"https://api.github.com/repos/azu/textlint-rule-prh/pulls{/number}","milestones_url":"https://api.github.com/repos/azu/textlint-rule-prh/milestones{/number}","notifications_url":"https://api.github.com/repos/azu/textlint-rule-prh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azu/textlint-rule-prh/labels{/name}","releases_url":"https://api.github.com/repos/azu/textlint-rule-prh/releases{/id}","deployments_url":"https://api.github.com/repos/azu/textlint-rule-prh/deployments","created_at":"2015-09-12T15:59:04Z","updated_at":"2016-01-23T14:25:41Z","pushed_at":"2016-04-20T06:50:32Z","git_url":"git://github.com/azu/textlint-rule-prh.git","ssh_url":"git@github.com:azu/textlint-rule-prh.git","clone_url":"https://github.com/azu/textlint-rule-prh.git","svn_url":"https://github.com/azu/textlint-rule-prh","homepage":null,"size":26,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8"},"html":{"href":"https://github.com/azu/textlint-rule-prh/pull/8"},"issue":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/issues/8"},"comments":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/azu/textlint-rule-prh/statuses/ee0c484b8134a95a32006c2b78fb9b351cad9c77"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"azu","id":19714,"avatar_url":"https://avatars.githubusercontent.com/u/19714?v=3","gravatar_id":"","url":"https://api.github.com/users/azu","html_url":"https://github.com/azu","followers_url":"https://api.github.com/users/azu/followers","following_url":"https://api.github.com/users/azu/following{/other_user}","gists_url":"https://api.github.com/users/azu/gists{/gist_id}","starred_url":"https://api.github.com/users/azu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azu/subscriptions","organizations_url":"https://api.github.com/users/azu/orgs","repos_url":"https://api.github.com/users/azu/repos","events_url":"https://api.github.com/users/azu/events{/privacy}","received_events_url":"https://api.github.com/users/azu/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":18,"deletions":3,"changed_files":3}}