{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2912","repository_url":"https://api.github.com/repos/bbatsov/rubocop","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2912/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2912/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2912/events","html_url":"https://github.com/bbatsov/rubocop/issues/2912","id":138581460,"number":2912,"title":"rubocop reports false positives.","user":{"login":"jottr","id":2744198,"avatar_url":"https://avatars.githubusercontent.com/u/2744198?v=3","gravatar_id":"","url":"https://api.github.com/users/jottr","html_url":"https://github.com/jottr","followers_url":"https://api.github.com/users/jottr/followers","following_url":"https://api.github.com/users/jottr/following{/other_user}","gists_url":"https://api.github.com/users/jottr/gists{/gist_id}","starred_url":"https://api.github.com/users/jottr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jottr/subscriptions","organizations_url":"https://api.github.com/users/jottr/orgs","repos_url":"https://api.github.com/users/jottr/repos","events_url":"https://api.github.com/users/jottr/events{/privacy}","received_events_url":"https://api.github.com/users/jottr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-04T20:41:26Z","updated_at":"2016-03-05T04:25:12Z","closed_at":null,"body":"## Expected behavior\r\n\r\nrubocop should not report any errors.\r\n\r\n## Actual behavior\r\n\r\nrubocop reports errors, which do not exist, even after running `rubocop -a`\r\n\r\n## Steps to reproduce the problem\r\n```\r\n$ rubocop -a app/controllers/api/wishes_controller.rb\r\nInspecting 1 file\r\nC\r\n\r\nOffenses:\r\n\r\napp/controllers/api/wishes_controller.rb:9:15: C: [Corrected] = is not aligned with the following assignment.\r\n    wish      = Wish.where(text: params[:text]).first\r\n              ^\r\napp/controllers/api/wishes_controller.rb:17:28: C: [Corrected] = is not aligned with the following assignment.\r\n        initial_wishes     = sugg.initial_wishes\r\n                           ^\r\napp/controllers/api/wishes_controller.rb:47:14: C: [Corrected] = is not aligned with the following assignment.\r\n    user_ids = Wish.find(params[:id]).user_ids\r\n             ^\r\napp/controllers/api/wishes_controller.rb:53:14: C: [Corrected] = is not aligned with the following assignment.\r\n    user_ids = Wish.find(params[:id]).user_ids\r\n             ^\r\napp/controllers/api/wishes_controller.rb:71:11: C: [Corrected] = is not aligned with the following assignment.\r\n    wish  = Wish.find(params[:id])\r\n          ^\r\napp/controllers/api/wishes_controller.rb:94:12: C: [Corrected] = is not aligned with the following assignment.\r\n      user = wish.users.where.not('users.avatar' => nil).sample\r\n           ^\r\napp/controllers/api/wishes_controller.rb:121:18: C: [Corrected] = is not aligned with the following assignment.\r\n      params[:q] = params[:q].gsub(/ich würde/i,'')\r\n                 ^\r\napp/controllers/api/wishes_controller.rb:142:12: C: [Corrected] = is not aligned with the following assignment.\r\n      user = wish.users.where.not('users.avatar' => nil).sample unless params[:q]\r\n           ^\r\n\r\n1 file inspected, 8 offenses detected, 8 offenses corrected\r\n\r\n$ git status\r\nOn branch develop\r\nnothing to commit, working directory clean\r\n\r\n$ rubocop -a app/controllers/api/wishes_controller.rb\r\nInspecting 1 file\r\n\r\n[....]\r\n\r\n1 file inspected, 8 offenses detected, 8 offenses corrected\r\n\r\n```\r\nAs you can see, the same errors are reported, even after rubocop claims to have fixed them. \r\nHere's a snippet of the first offense reported by rubocop: \r\n\r\n```\r\n# wishes_controller.rb line 9-10\r\n wish      = Wish.where(text: params[:text]).first\r\n wish      = Wish.create(params.permit(:text)) unless wish\r\n\r\n```\r\nAs you can see, the alignments __are__ properly aligned.\r\n\r\n## RuboCop version\r\n\r\nInclude the output of `rubocop -V`:\r\n\r\n```\r\n$ rubocop -V\r\n0.16.0 (using Parser 2.1.2, running on ruby 2.0.0 x86_64-darwin12.4.0)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/192566895","html_url":"https://github.com/bbatsov/rubocop/issues/2912#issuecomment-192566895","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2912","id":192566895,"user":{"login":"alexdowad","id":1067359,"avatar_url":"https://avatars.githubusercontent.com/u/1067359?v=3","gravatar_id":"","url":"https://api.github.com/users/alexdowad","html_url":"https://github.com/alexdowad","followers_url":"https://api.github.com/users/alexdowad/followers","following_url":"https://api.github.com/users/alexdowad/following{/other_user}","gists_url":"https://api.github.com/users/alexdowad/gists{/gist_id}","starred_url":"https://api.github.com/users/alexdowad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexdowad/subscriptions","organizations_url":"https://api.github.com/users/alexdowad/orgs","repos_url":"https://api.github.com/users/alexdowad/repos","events_url":"https://api.github.com/users/alexdowad/events{/privacy}","received_events_url":"https://api.github.com/users/alexdowad/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T04:25:12Z","updated_at":"2016-03-05T04:25:12Z","body":"Rubocop 0.16.0?? That is more than 2 years old. The latest version is 0.37.2.\r\n\r\nThe problem doesn't occur on `master`, so this issue can be closed."}}