Skip to content

Commit 90797d1

Browse files
authored
Merge pull request #423 from tnir/tnir/reenable-rubocop-with-ruby-2.3-compat
Apply RuboCop linting for Ruby 2.3
2 parents eabd220 + 180938b commit 90797d1

File tree

7 files changed

+18
-21
lines changed

7 files changed

+18
-21
lines changed

.rubocop.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ AllCops:
66
- rake.gemspec
77
- bin/*
88

9-
Metrics/LineLength:
10-
Enabled: true
11-
Max: 120
12-
139
Style/HashSyntax:
1410
Enabled: true
1511

@@ -23,8 +19,9 @@ Style/MultilineIfThen:
2319
Style/MethodDefParentheses:
2420
Enabled: true
2521

26-
Style/BracesAroundHashParameters:
22+
Layout/LineLength:
2723
Enabled: true
24+
Max: 120
2825

2926
Layout/IndentationWidth:
3027
Enabled: true
@@ -35,7 +32,7 @@ Layout/Tab:
3532
Layout/EmptyLines:
3633
Enabled: true
3734

38-
Layout/TrailingBlankLines:
35+
Layout/TrailingEmptyLines:
3936
Enabled: true
4037

4138
Layout/TrailingWhitespace:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ group :development do
66
gem "bundler"
77
gem "minitest"
88
gem "coveralls"
9-
gem "rubocop"
9+
gem "rubocop", "~> 0.81.0"
1010
end

lib/rake/task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ def execute(args=nil)
276276
application.trace "** Execute #{name}" if application.options.trace
277277
application.enhance_with_matching_rule(name) if @actions.empty?
278278
if opts = Hash.try_convert(args) and !opts.empty?
279-
@actions.each { |act| act.call(self, args, **opts)}
279+
@actions.each { |act| act.call(self, args, **opts) }
280280
else
281-
@actions.each { |act| act.call(self, args)}
281+
@actions.each { |act| act.call(self, args) }
282282
end
283283
end
284284

test/test_rake_clean.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class TestRakeClean < Rake::TestCase # :nodoc:
66
def test_clean
7-
if RUBY_ENGINE == 'truffleruby' and RUBY_ENGINE_VERSION.start_with?('19.3.')
7+
if RUBY_ENGINE == "truffleruby" and RUBY_ENGINE_VERSION.start_with?("19.3.")
88
load "rake/clean.rb" # TruffleRuby 19.3 does not set self correctly with wrap=true
99
else
1010
load "rake/clean.rb", true

test/test_rake_file_list.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def test_clone_and_dup
496496
assert_equal ["a", "b", "c"], d
497497
end
498498

499-
if RUBY_VERSION < '2.7'
499+
if RUBY_VERSION < "2.7"
500500
def test_dup_and_clone_replicate_taint
501501
a = FileList["a", "b", "c"]
502502
a.taint

test/test_rake_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_can_triple_invoke_after_exception_with_reenable
126126
next if !raise_exception
127127

128128
raise_exception = false
129-
raise 'Some error'
129+
raise "Some error"
130130
end
131131

132132
assert_raises(RuntimeError) { t1.invoke }

test/test_rake_test_task.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,20 @@ def test_task_prerequisites_deps
171171
end
172172

173173
def test_task_order_only_prerequisites
174-
t = task(a: 'b') {
174+
t = task(a: "b") {
175175
:aaa
176-
} | 'c'
177-
b, c = task('b'), task('c')
178-
assert_equal ['b'], t.prerequisites
179-
assert_equal ['c'], t.order_only_prerequisites
176+
} | "c"
177+
b, c = task("b"), task("c")
178+
assert_equal ["b"], t.prerequisites
179+
assert_equal ["c"], t.order_only_prerequisites
180180
assert_equal [b, c], t.prerequisite_tasks
181181
end
182182

183183
def test_task_order_only_prerequisites_key
184-
t = task 'a' => 'b', order_only: ['c']
185-
b, c = task('b'), task('c')
186-
assert_equal ['b'], t.prerequisites
187-
assert_equal ['c'], t.order_only_prerequisites
184+
t = task "a" => "b", order_only: ["c"]
185+
b, c = task("b"), task("c")
186+
assert_equal ["b"], t.prerequisites
187+
assert_equal ["c"], t.order_only_prerequisites
188188
assert_equal [b, c], t.prerequisite_tasks
189189
end
190190
end

0 commit comments

Comments
 (0)