Skip to content

Commit 60a8524

Browse files
authored
Merge pull request #23 from jessereynolds/rubocop_rake
rubocop fixes for vox.rake
2 parents 80266ef + 1d3d206 commit 60a8524

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

.rubocop_todo.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,7 @@ Layout/ClosingHeredocIndentation:
2727
Layout/EmptyLineAfterGuardClause:
2828
Enabled: false
2929

30-
# Offense count: 4
31-
# This cop supports safe autocorrection (--autocorrect).
32-
# Configuration parameters: IndentationWidth.
33-
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
34-
Layout/FirstArrayElementIndentation:
35-
EnforcedStyle: special_inside_parentheses
36-
37-
# Offense count: 6
38-
# This cop supports safe autocorrection (--autocorrect).
39-
# Configuration parameters: IndentationWidth.
40-
# SupportedStyles: special_inside_parentheses, consistent, align_braces
41-
Layout/FirstHashElementIndentation:
42-
EnforcedStyle: special_inside_parentheses
43-
44-
# Offense count: 664
30+
# Offense count: 666
4531
# This cop supports safe autocorrection (--autocorrect).
4632
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
4733
# SupportedHashRocketStyles: key, separator, table
@@ -80,14 +66,6 @@ Layout/LineContinuationSpacing:
8066
Layout/LineEndStringConcatenationIndentation:
8167
Enabled: false
8268

83-
# Offense count: 3
84-
# This cop supports safe autocorrection (--autocorrect).
85-
# Configuration parameters: EnforcedStyleForEmptyBraces.
86-
# SupportedStyles: space, no_space, compact
87-
# SupportedStylesForEmptyBraces: space, no_space
88-
Layout/SpaceInsideHashLiteralBraces:
89-
EnforcedStyle: space
90-
9169
# Offense count: 2
9270
# This cop supports safe autocorrection (--autocorrect).
9371
# Configuration parameters: EnforcedStyle.
@@ -1157,7 +1135,7 @@ Style/StderrPuts:
11571135
Style/StringConcatenation:
11581136
Enabled: false
11591137

1160-
# Offense count: 3466
1138+
# Offense count: 3463
11611139
# This cop supports safe autocorrection (--autocorrect).
11621140
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
11631141
# SupportedStyles: single_quotes, double_quotes
@@ -1194,7 +1172,7 @@ Style/TrailingCommaInArguments:
11941172
Style/TrailingCommaInArrayLiteral:
11951173
Enabled: false
11961174

1197-
# Offense count: 1610
1175+
# Offense count: 1609
11981176
# This cop supports safe autocorrection (--autocorrect).
11991177
# Configuration parameters: EnforcedStyleForMultiline.
12001178
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma

rakelib/vox.rake

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ namespace :vox do
55
task 'version:bump:full', [:version] do |_, args|
66
abort 'You must provide a tag.' if args[:version].nil? || args[:version].empty?
77
version = args[:version]
8-
abort "#{version} does not appear to be a valid version string in x.y.z format" unless Gem::Version.correct?(version)
9-
8+
unless Gem::Version.correct?(version)
9+
abort "#{version} does not appear to be a valid version string in x.y.z format"
10+
end
1011
# Update lib/bolt/version.rb and openbolt.gemspec
1112
puts "Setting version to #{version}"
1213

1314
data = File.read('lib/bolt/version.rb')
1415
new_data = data.sub(/VERSION = '\d+\.\d+\.\d+(-\w+(\..*)?)?'/, "VERSION = '#{version}'")
15-
if data != new_data
16-
File.write('lib/bolt/version.rb', new_data)
17-
else
16+
if data == new_data
1817
warn 'Failed to update version in lib/bolt/version.rb'
18+
else
19+
File.write('lib/bolt/version.rb', new_data)
1920
end
2021

2122
data = File.read('openbolt.gemspec')
2223
new_data = data.sub(/(spec.version *=) '\d+\.\d+\.\d+(-\w+(\.\w+)?)?'/, "\\1 '#{version}'")
23-
if data != new_data
24-
File.write('openbolt.gemspec', new_data)
25-
else
24+
if data == new_data
2625
warn 'Failed to update version in openbolt.gemspec'
26+
else
27+
File.write('openbolt.gemspec', new_data)
2728
end
2829
end
2930
end
30-

0 commit comments

Comments
 (0)