Skip to content

Commit 9893350

Browse files
committed
Upgrade RuboCop 0.35.1 -> 0.36.0 for Travis builds
This required a number of fixes to address new cops introduced in version 0.36.0.
1 parent 37a62b4 commit 9893350

19 files changed

+53
-40
lines changed

.rubocop.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Style/FormatString:
5454
Style/GuardClause:
5555
Enabled: false
5656

57+
Style/IndentArray:
58+
Enabled: false
59+
5760
Style/IfUnlessModifier:
5861
Enabled: false
5962

@@ -63,6 +66,9 @@ Style/IfUnlessModifier:
6366
Style/Lambda:
6467
Enabled: false
6568

69+
Style/MultilineMethodCallIndentation:
70+
Enabled: false
71+
6672
Style/MultilineOperationIndentation:
6773
Enabled: false
6874

@@ -98,12 +104,15 @@ Style/SignalException:
98104
Style/SingleLineBlockParams:
99105
Enabled: false
100106

101-
Style/SingleSpaceBeforeFirstArg:
107+
Style/SpaceBeforeFirstArg:
102108
Exclude:
103109
- '*.gemspec'
104110

105111
Style/SpecialGlobalVars:
106112
Enabled: false
107113

108-
Style/TrailingComma:
114+
Style/TrailingCommaInArguments:
115+
Enabled: false
116+
117+
Style/TrailingCommaInLiteral:
109118
Enabled: false

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
44
gem 'coveralls'
55

66
# Pin RuboCop for Travis builds.
7-
gem 'rubocop', '0.35.1'
7+
gem 'rubocop', '0.36.0'
88

99
gemspec

lib/overcommit/configuration.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def initialize(hash, options = {})
1919
def ==(other)
2020
super || @hash == other.hash
2121
end
22-
alias_method :eql?, :==
2322

2423
# Access the configuration as if it were a hash.
2524
#

lib/overcommit/constants.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Global application constants.
22
module Overcommit
3-
HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
4-
CONFIG_FILE_NAME = '.overcommit.yml'
3+
HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
4+
CONFIG_FILE_NAME = '.overcommit.yml'.freeze
55

6-
HOOK_DIRECTORY = File.join(HOME, 'lib', 'overcommit', 'hook')
6+
HOOK_DIRECTORY = File.join(HOME, 'lib', 'overcommit', 'hook').freeze
77

8-
REPO_URL = 'https://github.com/brigade/overcommit'
9-
BUG_REPORT_URL = "#{REPO_URL}/issues"
8+
REPO_URL = 'https://github.com/brigade/overcommit'.freeze
9+
BUG_REPORT_URL = "#{REPO_URL}/issues".freeze
1010
end

lib/overcommit/hook/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def to_s
1111
end
1212

1313
# Possible types of messages.
14-
MESSAGE_TYPES = [:error, :warning]
14+
MESSAGE_TYPES = [:error, :warning].freeze
1515

1616
# Functionality common to all hooks.
1717
class Base # rubocop:disable Metrics/ClassLength

lib/overcommit/hook/commit_msg/capitalized_subject.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def run
55
return :pass if empty_message?
66

77
first_letter = commit_message_lines[0].to_s.match(/^[[:punct:]]*(.)/)[1]
8-
unless first_letter.match(/[[:upper:]]/)
8+
unless first_letter =~ /[[:upper:]]/
99
return :warn, 'Subject should start with a capital letter'
1010
end
1111

lib/overcommit/hook/pre_commit/berksfile_check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
44
#
55
# @see http://berkshelf.com/
66
class BerksfileCheck < Base
7-
LOCK_FILE = 'Berksfile.lock'
7+
LOCK_FILE = 'Berksfile.lock'.freeze
88

99
def run
1010
# Ignore if Berksfile.lock is not tracked by git

lib/overcommit/hook/pre_commit/bundle_check.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
44
#
55
# @see http://bundler.io/
66
class BundleCheck < Base
7-
LOCK_FILE = 'Gemfile.lock'
7+
LOCK_FILE = 'Gemfile.lock'.freeze
88

99
def run
1010
# Ignore if Gemfile.lock is not tracked by git

lib/overcommit/hook_signer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class HookSigner
55

66
# We don't want to include the skip setting as it is set by Overcommit
77
# itself
8-
IGNORED_CONFIG_KEYS = %w[skip]
8+
IGNORED_CONFIG_KEYS = %w[skip].freeze
99

1010
# @param hook_name [String] name of the hook
1111
# @param config [Overcommit::Configuration]

lib/overcommit/message_processor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ module Overcommit
66
# output tuple from an array of {Overcommit::Hook::Message}s, respecting the
77
# configuration settings for the given hook.
88
class MessageProcessor
9-
ERRORS_MODIFIED_HEADER = 'Errors on modified lines:'
10-
WARNINGS_MODIFIED_HEADER = 'Warnings on modified lines:'
11-
ERRORS_UNMODIFIED_HEADER = "Errors on lines you didn't modify:"
12-
WARNINGS_UNMODIFIED_HEADER = "Warnings on lines you didn't modify:"
9+
ERRORS_MODIFIED_HEADER = 'Errors on modified lines:'.freeze
10+
WARNINGS_MODIFIED_HEADER = 'Warnings on modified lines:'.freeze
11+
ERRORS_UNMODIFIED_HEADER = "Errors on lines you didn't modify:".freeze
12+
WARNINGS_UNMODIFIED_HEADER = "Warnings on lines you didn't modify:".freeze
1313

1414
# @param hook [Overcommit::Hook::Base]
1515
# @param unmodified_lines_setting [String] how to treat messages on

0 commit comments

Comments
 (0)