Add rubocop binstub that rspects file patterns

Best of both worlds!

(Because you can't override the default rubocop includes)

The binstub basically, lets me safely `rubocop test/foo_test.rb`
instead of `bundle exec rubocop test/foo_test.rb`

```bash
  # ~/.profile
  # https://twitter.com/tpope/status/165631968996900865
  # tl;dr `mkdir .git/safe` to add `bin` to path, e.g. `bin/rails`
  PATH=".git/safe/../../bin:$PATH"
```
This commit is contained in:
Benjamin Fleischer
2017-03-12 15:50:05 -05:00
parent 24c0212c83
commit a36b25d2db
4 changed files with 96 additions and 31 deletions

View File

@@ -1,10 +1,13 @@
AllCops:
TargetRubyVersion: 2.1
Exclude:
- config/initializers/forbidden_yaml.rb
- !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
DisplayCopNames: true
DisplayStyleGuide: true
# https://github.com/bbatsov/rubocop/blob/master/manual/caching.md
# https://github.com/bbatsov/rubocop/blob/e8680418b351491e111a18cf5b453fc07a3c5239/config/default.yml#L60-L77
UseCache: true
CacheRootDirectory: tmp
Rails:
Enabled: true