{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/5597","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5597/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5597/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5597/events","html_url":"https://github.com/bbatsov/rubocop/pull/5597","id":299977606,"number":5597,"title":"ADD Rails/HttpStatus cop","user":{"login":"anthony-robin","id":5428510,"avatar_url":"https://avatars2.githubusercontent.com/u/5428510?v=4","gravatar_id":"","url":"https://api.github.com/users/anthony-robin","html_url":"https://github.com/anthony-robin","followers_url":"https://api.github.com/users/anthony-robin/followers","following_url":"https://api.github.com/users/anthony-robin/following{/other_user}","gists_url":"https://api.github.com/users/anthony-robin/gists{/gist_id}","starred_url":"https://api.github.com/users/anthony-robin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthony-robin/subscriptions","organizations_url":"https://api.github.com/users/anthony-robin/orgs","repos_url":"https://api.github.com/users/anthony-robin/repos","events_url":"https://api.github.com/users/anthony-robin/events{/privacy}","received_events_url":"https://api.github.com/users/anthony-robin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-24T22:18:04Z","updated_at":"2018-03-14T12:29:21Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/bbatsov/rubocop/pulls/5597","html_url":"https://github.com/bbatsov/rubocop/pull/5597","diff_url":"https://github.com/bbatsov/rubocop/pull/5597.diff","patch_url":"https://github.com/bbatsov/rubocop/pull/5597.patch"},"body":"This cop enforces consistent use of `symbolic` or `numeric` value to define HTTP status.\r\n\r\n@example EnforcedStyle: symbolic (default)\r\n```ruby\r\n  # bad\r\n  render :foo, status: 200\r\n  render json: { foo: 'bar' }, status: 200\r\n  render plain: 'foo/bar', status: 304\r\n  redirect_to root_url, status: 301\r\n\r\n  # good\r\n  render :foo, status: :ok\r\n  render json: { foo: 'bar' }, status: :ok\r\n  render plain: 'foo/bar', status: :not_modified\r\n  redirect_to root_url, status: :moved_permanently\r\n```\r\n\r\n@example EnforcedStyle: numeric\r\n```ruby\r\n  # bad\r\n  render :foo, status: :ok\r\n  render json: { foo: 'bar' }, status: :not_found\r\n  render plain: 'foo/bar', status: :not_modified\r\n  redirect_to root_url, status: :moved_permanently\r\n\r\n  # good\r\n  render :foo, status: 200\r\n  render json: { foo: 'bar' }, status: 404\r\n  render plain: 'foo/bar', status: 304\r\n  redirect_to root_url, status: 301\r\n```\r\n\r\nInspired from the `Rails/HttpStatus` cop in the [rubocop-rspec][1]\r\nrepository and its [refactored version][2].\r\n\r\n[1]: https://github.com/backus/rubocop-rspec/pull/546\r\n[2]: https://github.com/backus/rubocop-rspec/pull/553\r\n\r\n-----------------\r\n\r\nBefore submitting the PR make sure the following are checked:\r\n\r\n* [x] Wrote [good commit messages][1].\r\n* [ ] Commit message starts with `[Fix #issue-number]` (if the related issue exists).\r\n* [x] Feature branch is up-to-date with `master` (if not - rebase it).\r\n* [x] Squashed related commits together.\r\n* [x] Added tests.\r\n* [x] Added an entry to the [Changelog](../blob/master/CHANGELOG.md) if the new code introduces user-observable changes. See [changelog entry format](../blob/master/CONTRIBUTING.md#changelog-entry-format).\r\n* [x] The PR relates to *only* one subject with a clear title\r\n  and description in grammatically correct, complete sentences.\r\n* [x] Run `rake default` or `rake parallel`. It executes all tests and RuboCop for itself, and generates the documentation.\r\n\r\n[1]: http://chris.beams.io/posts/git-commit/\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/373003739","html_url":"https://github.com/bbatsov/rubocop/pull/5597#issuecomment-373003739","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/5597","id":373003739,"user":{"login":"pocke","id":4361134,"avatar_url":"https://avatars0.githubusercontent.com/u/4361134?v=4","gravatar_id":"","url":"https://api.github.com/users/pocke","html_url":"https://github.com/pocke","followers_url":"https://api.github.com/users/pocke/followers","following_url":"https://api.github.com/users/pocke/following{/other_user}","gists_url":"https://api.github.com/users/pocke/gists{/gist_id}","starred_url":"https://api.github.com/users/pocke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocke/subscriptions","organizations_url":"https://api.github.com/users/pocke/orgs","repos_url":"https://api.github.com/users/pocke/repos","events_url":"https://api.github.com/users/pocke/events{/privacy}","received_events_url":"https://api.github.com/users/pocke/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T12:29:21Z","updated_at":"2018-03-14T12:29:21Z","author_association":"COLLABORATOR","body":"The build on Travis CI has been failed, can you re-execute `rake generate_cops_documentation`?"}}
{"actor":{"display_login":"pocke"}}