{"action":"created","issue":{"url":"https://api.github.com/repos/vvakame/prh/issues/18","repository_url":"https://api.github.com/repos/vvakame/prh","labels_url":"https://api.github.com/repos/vvakame/prh/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/vvakame/prh/issues/18/comments","events_url":"https://api.github.com/repos/vvakame/prh/issues/18/events","html_url":"https://github.com/vvakame/prh/issues/18","id":157227150,"number":18,"title":"同一のexpectedの値を持つルールが複数あるとルールが適用されない場合がある","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},"labels":[],"state":"open","locked":false,"assignee":{"login":"vvakame","id":125332,"avatar_url":"https://avatars.githubusercontent.com/u/125332?v=3","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-27T15:05:42Z","updated_at":"2016-05-30T12:11:12Z","closed_at":null,"body":"## 環境\r\n\r\n```\r\n$ prh --version\r\n1.0.0\r\n```\r\n\r\n## 問題\r\n\r\n同一のexpectedの値を持つルールが複数ある設定ファイル`prh.yml`と、\r\n\r\n```\r\n$ cat prh.yml\r\nversion: 1\r\nrules:\r\n  - expected: ブラウザ\r\n    pattern: /Webブラウザー?|WEBブラウザー?/\r\n\r\n  - expected: ブラウザ\r\n    pattern: ブラウザー\r\n```\r\n\r\nそのファイルをインポートする設定ファイル`import.yml`の2つを用意します。\r\n\r\n```\r\n$ cat import.yml\r\nversion: 1\r\nimports:\r\n   - ./prh.yml\r\n```\r\n\r\nサンプルの文章を用意します。\r\n\r\n```\r\n$ cat sample.md\r\nWebブラウザを開き\r\nブラウザーの開発者ツールで要素を検証します。\r\n```\r\n\r\n`prh.yml`を使用した場合は、意図したとおり2つのルールが両方使われますが、\r\n\r\n```\r\n$ prh --rules prh.yml sample.md\r\nブラウザを開き\r\nブラウザの開発者ツールで要素を検証します。\r\n```\r\n\r\n`import.yml`を使用した場合は、2つ目のルールは使用されません。これは意図しない結果です。\r\n\r\n```\r\n$ prh --rules import.yml sample.md\r\nブラウザを開き\r\nブラウザーの開発者ツールで要素を検証します。\r\n```\r\n\r\n両者が異なる結果になるのは直感に反するので、同じ結果になるほうが良いと思います。または、同じファイルに同一のexpectedの値を持つルールが複数あることは認められないのであれば、ルールのロード時にエラーになると良いと思います。\r\n\r\n## 参考\r\n\r\n* https://github.com/azu/textlint-rule-web-plus-db/blob/1.1.5/dict/web%2Bdb_press.yml#L362-367"},"comment":{"url":"https://api.github.com/repos/vvakame/prh/issues/comments/222479164","html_url":"https://github.com/vvakame/prh/issues/18#issuecomment-222479164","issue_url":"https://api.github.com/repos/vvakame/prh/issues/18","id":222479164,"user":{"login":"vvakame","id":125332,"avatar_url":"https://avatars.githubusercontent.com/u/125332?v=3","gravatar_id":"","url":"https://api.github.com/users/vvakame","html_url":"https://github.com/vvakame","followers_url":"https://api.github.com/users/vvakame/followers","following_url":"https://api.github.com/users/vvakame/following{/other_user}","gists_url":"https://api.github.com/users/vvakame/gists{/gist_id}","starred_url":"https://api.github.com/users/vvakame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvakame/subscriptions","organizations_url":"https://api.github.com/users/vvakame/orgs","repos_url":"https://api.github.com/users/vvakame/repos","events_url":"https://api.github.com/users/vvakame/events{/privacy}","received_events_url":"https://api.github.com/users/vvakame/received_events","type":"User","site_admin":false},"created_at":"2016-05-30T12:11:12Z","updated_at":"2016-05-30T12:11:12Z","body":"yamlはJSONに置換可能なものであると考えておきたいので、エラーにするのが良さそうですね。"}}
{"actor":{"display_login":"vvakame"}}