From 0d781082eaa9f04f5709647d88876cf331960a9f Mon Sep 17 00:00:00 2001 From: Josh Hagins Date: Sun, 19 Jul 2015 16:59:36 -0400 Subject: [PATCH 1/2] Include template hook in RuboCop check --- .overcommit.yml | 5 +++++ 1 file changed, 5 insertions(+) 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 From d376ae8b4cd70a0d32015503fb5f2b3005d99c2c Mon Sep 17 00:00:00 2001 From: Josh Hagins Date: Sun, 19 Jul 2015 17:03:40 -0400 Subject: [PATCH 2/2] Disable RescueModifier cop for line in overcommit-hook --- template-dir/hooks/overcommit-hook | 2 ++ 1 file changed, 2 insertions(+) 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'