{"action":"created","issue":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/4961","repository_url":"https://api.github.com/repos/rubocop-hq/rubocop","labels_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/4961/labels{/name}","comments_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/4961/comments","events_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/4961/events","html_url":"https://github.com/rubocop-hq/rubocop/issues/4961","id":269394357,"node_id":"MDU6SXNzdWUyNjkzOTQzNTc=","number":4961,"title":"Include list/whitelist for files to check by RuboCop","user":{"login":"eregon","id":168854,"node_id":"MDQ6VXNlcjE2ODg1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/168854?v=4","gravatar_id":"","url":"https://api.github.com/users/eregon","html_url":"https://github.com/eregon","followers_url":"https://api.github.com/users/eregon/followers","following_url":"https://api.github.com/users/eregon/following{/other_user}","gists_url":"https://api.github.com/users/eregon/gists{/gist_id}","starred_url":"https://api.github.com/users/eregon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eregon/subscriptions","organizations_url":"https://api.github.com/users/eregon/orgs","repos_url":"https://api.github.com/users/eregon/repos","events_url":"https://api.github.com/users/eregon/events{/privacy}","received_events_url":"https://api.github.com/users/eregon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-29T12:13:59Z","updated_at":"2018-09-19T04:58:55Z","closed_at":"2018-09-19T04:58:55Z","author_association":"NONE","body":"It seems currently RuboCop always scans every `.rb`/`#!ruby` file under the current directory if not explictly passed filenames on the command-line.\r\n\r\nIn the config, `Include` seems only useful to add non-`.rb` files (more like \"extra files\" to scan), and is not really related to `Exclude` (\"ignore those files when `$ rubocop` is invoked\").\r\n\r\nWhat I want is to be able to tell, in my RuboCop `.rubocop.yml` config, which files to check.\r\nSo for instance, I want to check everything under `lib/` and `bin/`, but nothing else.\r\nThis is particularly useful in projects where some of the Ruby files are imported form other projects (so modifying them for style is not an option), or where incrementally transitioning a code base to be checked by RuboCop.\r\nA real-world example of this can be seen in [TruffleRuby's RuboCop config](https://github.com/graalvm/truffleruby/blob/d9abd33980da0c6eee0f8cede98f85e64ab1b4f2/.rubocop.yml).\r\n\r\nCurrently, whitelisting files/dirs seems only possible if I pass the list to rubocop directly:\r\n```bash\r\n$ rubocop lib bin\r\n```\r\nBut not in the configuration file.\r\nThis quickly becomes cumbersome as this list grows or becomes more complex.\r\nAnd it forces me to have the list of files checked by RuboCop *outside* the RuboCop config.\r\n\r\nCurrently I am working around by having a very long `Exclude` list, but this feels wrong, because I want to specify what files are checked by RuboCop, not every other file/dir in the repo.\r\n\r\nIs there a way I missed to achieve what I want?\r\nIf not, do you think this feature would be worth adding to RuboCop?\r\n\r\n## RuboCop version\r\n\r\n```\r\n$ rubocop -V\r\n0.51.0 (using Parser 2.4.0.0, running on ruby 2.4.1 x86_64-linux)\r\n```"},"comment":{"url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/comments/422653121","html_url":"https://github.com/rubocop-hq/rubocop/issues/4961#issuecomment-422653121","issue_url":"https://api.github.com/repos/rubocop-hq/rubocop/issues/4961","id":422653121,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjY1MzEyMQ==","user":{"login":"bbatsov","id":103882,"node_id":"MDQ6VXNlcjEwMzg4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/103882?v=4","gravatar_id":"","url":"https://api.github.com/users/bbatsov","html_url":"https://github.com/bbatsov","followers_url":"https://api.github.com/users/bbatsov/followers","following_url":"https://api.github.com/users/bbatsov/following{/other_user}","gists_url":"https://api.github.com/users/bbatsov/gists{/gist_id}","starred_url":"https://api.github.com/users/bbatsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbatsov/subscriptions","organizations_url":"https://api.github.com/users/bbatsov/orgs","repos_url":"https://api.github.com/users/bbatsov/repos","events_url":"https://api.github.com/users/bbatsov/events{/privacy}","received_events_url":"https://api.github.com/users/bbatsov/received_events","type":"User","site_admin":false},"created_at":"2018-09-19T04:58:55Z","updated_at":"2018-09-19T04:58:55Z","author_association":"COLLABORATOR","body":"We've removed the hardcoded default includes a few version ago, so your problem should be solved now. "}}
{"actor":{"display_login":"bbatsov"}}