diff --git a/.rubocop.yml b/.rubocop.yml index 1b4e7ad7..06fe033d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -70,7 +70,7 @@ Naming/FileName: # Renaming `has_something?` to `something?` obfuscates whether it is a "is-a" or # a "has-a" relationship. -Naming/PredicateName: +Naming/PredicatePrefix: Enabled: false # commit_sha1 is indeed how we want to write such a variable, so ignore this cop diff --git a/Gemfile b/Gemfile index 49dc7923..2c3a8bb3 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'simplecov-lcov', '~> 0.8.0' if RUBY_VERSION < '2.7.0' gem 'rubocop', '1.50.0' else - gem 'rubocop', '1.59.0' + gem 'rubocop', '1.77.0' end gem 'ffi' if Gem.win_platform? diff --git a/lib/overcommit/hook/pre_commit/scalastyle.rb b/lib/overcommit/hook/pre_commit/scalastyle.rb index 6494521d..b7a56c2a 100644 --- a/lib/overcommit/hook/pre_commit/scalastyle.rb +++ b/lib/overcommit/hook/pre_commit/scalastyle.rb @@ -24,7 +24,7 @@ def run extract_messages( messages, MESSAGE_REGEX, - lambda { |type| type.to_sym } + lambda(&:to_sym) ) end end diff --git a/template-dir/hooks/commit-msg b/template-dir/hooks/commit-msg index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/commit-msg +++ b/template-dir/hooks/commit-msg @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/overcommit-hook b/template-dir/hooks/overcommit-hook index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/overcommit-hook +++ b/template-dir/hooks/overcommit-hook @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/post-checkout b/template-dir/hooks/post-checkout index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/post-checkout +++ b/template-dir/hooks/post-checkout @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/post-commit b/template-dir/hooks/post-commit index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/post-commit +++ b/template-dir/hooks/post-commit @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/post-merge b/template-dir/hooks/post-merge index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/post-merge +++ b/template-dir/hooks/post-merge @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/post-rewrite b/template-dir/hooks/post-rewrite index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/post-rewrite +++ b/template-dir/hooks/post-rewrite @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/pre-commit b/template-dir/hooks/pre-commit index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/pre-commit +++ b/template-dir/hooks/pre-commit @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/pre-push b/template-dir/hooks/pre-push index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/pre-push +++ b/template-dir/hooks/pre-push @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/pre-rebase b/template-dir/hooks/pre-rebase index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/pre-rebase +++ b/template-dir/hooks/pre-rebase @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit' diff --git a/template-dir/hooks/prepare-commit-msg b/template-dir/hooks/prepare-commit-msg index 87ffeb58..039e82a0 100755 --- a/template-dir/hooks/prepare-commit-msg +++ b/template-dir/hooks/prepare-commit-msg @@ -42,7 +42,6 @@ if gemfile exit 78 # EX_CONFIG end end -# rubocop:enable Style/RescueModifier begin require 'overcommit'