I noticed that Style/FileName invalidates Gemfile and Rakefile. Since they're extremely common, they should be whitelisted.
I don't know if this is already possible to do; if so, it would be nice to have some help.
Related checker: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml#L260-L263
I cannot seem to reproduce your problem with rubocop 0.35.1:
~/src/wright % bundle exec rubocop Rakefile Gemfile
Inspecting 2 files
..
2 files inspected, no offenses detected
rubocop's sources:
~/src/rubocop % bundle exec rubocop Rakefile Gemfile
Inspecting 2 files
..
2 files inspected, no offenses detected
Can you please describe in more detail how to reproduce this issue?
I suggest this can be closed until someone comes forward with a way to reproduce the issue.
I'm having the same problem here:
$ rubocop Gemfile
Inspecting 1 file
C
Offenses:
Gemfile:1:1: C: Style/FileName: Use snake_case for source file names.
source 'https://rubygems.org'
^
1 file inspected, 1 offense detected
2.3.00.38.0@lucascaton I wonder if you're setting AllCops: Include in your .rubocop.yml. That could be the reason.
@lucascaton Can you please show us your rubocop config (.rubocop.yml)?
@jonas054: adding **/Gemfile to my AllCops: Include fixed the problem, thanks!
# .rubocop.yml
AllCops:
Include:
- '**/Gemfile'
cc/ @sometimesfood
As per readme:
The file config/default.yml under the RuboCop home directory contains the default settings that all configurations inherit from. Project and personal .rubocop.yml files need only make settings that are different from the default ones. If there is no .rubocop.yml file in the project or home directory, config/default.yml will be used.
Shouldn't my ~/.rubocop.yml inherit from rubocop's default.yml configuration, making the Include configuration optional?
@fnando It does override the default configuration, but you might have a different idea about how this should work compared to what actually happens (which is that lists such as AllCops: Include are overridden by local configuration, there is no merging). I'm re-opening this issue so I can close it with a PR that clarifies the inheritance and overriding functionality in the README.
Most helpful comment
@jonas054: adding
**/Gemfileto myAllCops: Includefixed the problem, thanks!cc/ @sometimesfood