Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running rubocop . causes .rubocop.yml to be ignored #997

Closed
andyw8 opened this issue Apr 12, 2014 · 6 comments
Closed

Running rubocop . causes .rubocop.yml to be ignored #997

andyw8 opened this issue Apr 12, 2014 · 6 comments
Assignees

Comments

@andyw8
Copy link
Contributor

andyw8 commented Apr 12, 2014

I would expect rubocop . to give the same result as running rubocop but it appears to ignore my .rubocop.yml in the project root.

Mac OS X 10.9.2 with rbenv

@andyw8 andyw8 changed the title Running rubocop . causes .rubocop.yml to be ignore Running rubocop . causes .rubocop.yml to be ignored Apr 12, 2014
@jonas054
Copy link
Collaborator

I get a déjà vu feeling. Haven't we seen this (and fixed it) before?

Which version of RuboCop are you running? Please call rubocop -V. And also rubocop -d to confirm that is indeed not reading .rubocop.yml.

@andyw8
Copy link
Contributor Author

andyw8 commented Apr 12, 2014

0.20.1 (using Parser 2.1.7, running on ruby 2.0.0 x86_64-darwin12.3.0)

Notice the difference in the file count (31 vs 37):

rubocop -d

For /Users/andy/code/bitbucket/andyw8/my_project: configuration from /Users/andy/code/bitbucket/andyw8/my_project/.rubocop.yml
Default configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/default.yml
Inheriting configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/enabled.yml
Inheriting configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/disabled.yml
Inspecting 31 files

rubcop . -d

For .: configuration from /Users/andy/code/bitbucket/andyw8/my_project/.rubocop.yml
Default configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/default.yml
Inheriting configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/enabled.yml
Inheriting configuration from /Users/andy/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rubocop-0.20.1/config/disabled.yml
Inspecting 37 files

@jonas054
Copy link
Collaborator

Those 6 files that aren't inspected by rubocop .; what are their paths? And do you have any Exclude or Include settings in your .rubocop.yml?

@andyw8
Copy link
Contributor Author

andyw8 commented Apr 12, 2014

Here's my .rubocop.yml:

AllCops:
  Exclude:
    - db/schema.rb
    - db/seeds.rb
    - db/migrate/*.rb
    - config/initializers/devise.rb

@jonas054 jonas054 self-assigned this Apr 12, 2014
bbatsov added a commit that referenced this issue Apr 12, 2014
[Fix #997] Make sure paths are on normal form for exclude
@andyw8
Copy link
Contributor Author

andyw8 commented Apr 12, 2014

Thank you!

@jonas054
Copy link
Collaborator

No problem, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants