diff --git a/.overcommit.yml b/.overcommit.yml index 96554c68..bb56eb58 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -8,6 +8,11 @@ PreCommit: RuboCop: enabled: true command: ['bundle', 'exec', 'rubocop'] + include: + - '**/*.gemspec' + - '**/*.rb' + - '**/Gemfile' + - template-dir/hooks/overcommit-hook TravisLint: enabled: true diff --git a/template-dir/hooks/overcommit-hook b/template-dir/hooks/overcommit-hook index 86116f80..d10b8cf5 100755 --- a/template-dir/hooks/overcommit-hook +++ b/template-dir/hooks/overcommit-hook @@ -27,10 +27,12 @@ end # Check if Overcommit should invoke a Bundler context for loading gems require 'yaml' +# rubocop:disable Style/RescueModifier if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil ENV['BUNDLE_GEMFILE'] = gemfile require 'bundler/setup' end +# rubocop:enable Style/RescueModifier begin require 'overcommit'