{"action":"created","issue":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/2324","labels_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2324/labels{/name}","comments_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2324/comments","events_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2324/events","html_url":"https://github.com/bbatsov/rubocop/issues/2324","id":111856514,"number":2324,"title":"Can't run Rubocop with only Lint/Syntax cop.","user":{"login":"savef","id":6241279,"avatar_url":"https://avatars.githubusercontent.com/u/6241279?v=3","gravatar_id":"","url":"https://api.github.com/users/savef","html_url":"https://github.com/savef","followers_url":"https://api.github.com/users/savef/followers","following_url":"https://api.github.com/users/savef/following{/other_user}","gists_url":"https://api.github.com/users/savef/gists{/gist_id}","starred_url":"https://api.github.com/users/savef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savef/subscriptions","organizations_url":"https://api.github.com/users/savef/orgs","repos_url":"https://api.github.com/users/savef/repos","events_url":"https://api.github.com/users/savef/events{/privacy}","received_events_url":"https://api.github.com/users/savef/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bbatsov/rubocop/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"jonas054","id":336720,"avatar_url":"https://avatars.githubusercontent.com/u/336720?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas054","html_url":"https://github.com/jonas054","followers_url":"https://api.github.com/users/jonas054/followers","following_url":"https://api.github.com/users/jonas054/following{/other_user}","gists_url":"https://api.github.com/users/jonas054/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas054/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas054/subscriptions","organizations_url":"https://api.github.com/users/jonas054/orgs","repos_url":"https://api.github.com/users/jonas054/repos","events_url":"https://api.github.com/users/jonas054/events{/privacy}","received_events_url":"https://api.github.com/users/jonas054/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-10-16T15:38:34Z","updated_at":"2015-10-19T12:39:24Z","closed_at":"2015-10-17T21:28:57Z","body":"Trying to just check syntax with Rubocop using the command `rubocop --only Lint/Syntax` fails with \"Unrecognised cop or namespace\".\r\n\r\nI was able to only run the syntax cop with `rubocop --only \"\"`, but this looks very hacky so I don't think it's a solution. (Note that `rubocop --only` fails trying to call `Array#split` on `nil`, this might want to be fixed, to behave the same as passing `\"\"`).\r\n\r\nAfter some very quick digging it seems the issue with the missing cop is due to `RuboCop::Cop::Cop.all` not exposing *Lint/Syntax* as a real cop, I imagine there are various reasons for this so I doubt changing that is the solution, and popping `Lint/Syntax` onto the cops array only in `RuboCop::Options` might get messy. Therefore I think the simplest solution might be to add a new switch such as `rubocop --syntax`, that only runs the syntax checker and exits (being functionally the same as what `rubocop --only \"\"` does now).\r\n\r\nVersion: `0.34.2 (using Parser 2.2.3.0, running on ruby 2.2.3 x86_64-linux)`\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/bbatsov/rubocop/issues/comments/149202156","html_url":"https://github.com/bbatsov/rubocop/issues/2324#issuecomment-149202156","issue_url":"https://api.github.com/repos/bbatsov/rubocop/issues/2324","id":149202156,"user":{"login":"savef","id":6241279,"avatar_url":"https://avatars.githubusercontent.com/u/6241279?v=3","gravatar_id":"","url":"https://api.github.com/users/savef","html_url":"https://github.com/savef","followers_url":"https://api.github.com/users/savef/followers","following_url":"https://api.github.com/users/savef/following{/other_user}","gists_url":"https://api.github.com/users/savef/gists{/gist_id}","starred_url":"https://api.github.com/users/savef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savef/subscriptions","organizations_url":"https://api.github.com/users/savef/orgs","repos_url":"https://api.github.com/users/savef/repos","events_url":"https://api.github.com/users/savef/events{/privacy}","received_events_url":"https://api.github.com/users/savef/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T12:39:24Z","updated_at":"2015-10-19T12:39:24Z","body":"Thanks!"}}