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

Settings global exclude pattern in my $HOME/.rubocop.yml #2261

Closed
zw963 opened this issue Sep 19, 2015 · 2 comments
Closed

Settings global exclude pattern in my $HOME/.rubocop.yml #2261

zw963 opened this issue Sep 19, 2015 · 2 comments
Labels

Comments

@zw963
Copy link

zw963 commented Sep 19, 2015

I want to add all my project exclude pattern in my $HOME/.rubycop.yml

so, I have to add like this:

AllCops:
  Include:
    - '**/Rakefile'
    - '**/config.ru'
  Exclude:
  - '**/vendor/**/*'
  - '**/spec/fixtures/**/*'
  - '**/db/schema.rb'
  - '**/db/migrate/*'
  - '**/bin/bundle'
  - '**/bin/rails'
  - '**/bin/rake'
  - '**/bin/setup'
  - '**/bin/spring'
  - '**/config/**/*'
  - '**/script/**/*'

But, I think it maybe not reasonable, if remove the leading ** is more reasonable.
no one hope exclude some directory in $HOME after all.

Thanks

@jonas054
Copy link
Collaborator

This problem is very similar to the one that was fixed in #2264. Relative paths in files named .rubocop.yml are relative to the directory where that file is. The file $HOME/.rubocop.yml should be an exception to this rule, and paths there should be relative to the current directory.

@jonas054 jonas054 added the bug label Sep 21, 2015
@zw963
Copy link
Author

zw963 commented Sep 21, 2015

Thank for reply.
I think $HOME/.rubocop.yml path globbing config, it should be the default value for current project
missing config, so, it should be same behavior.

bbatsov added a commit that referenced this issue Oct 1, 2015
[Fix #2261] Exclude paths in ~/.rubocop_todo.yml relative to current dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants