From aedc33ca9c17297f448a4729c065427a650d487e Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:42:13 +0900 Subject: [PATCH 1/5] added rubocop to development dependency --- rake.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/rake.gemspec b/rake.gemspec index 4d1a223d2..9f9f356eb 100644 --- a/rake.gemspec +++ b/rake.gemspec @@ -39,4 +39,5 @@ Rake has the following features: s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) s.add_development_dependency(%q.freeze) + s.add_development_dependency(%q.freeze) end From de98d29359a47d8d0e753cc3bbcad67148b0f08a Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:42:33 +0900 Subject: [PATCH 2/5] Renamed obsoleted parameter AlignWith to EnforcedStyleAlignWith --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index acdf2e117..19f0bb798 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -54,4 +54,4 @@ Style/BracesAroundHashParameters: Lint/EndAlignment: Enabled: true - AlignWith: variable + EnforcedStyleAlignWith: variable From fb2320156611729467f986f6529b24e0fb692af7 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:10 +0900 Subject: [PATCH 3/5] Fixed deprecated warnings --- .rubocop.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 19f0bb798..25589b98c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ AllCops: - doc/**/*.rb - rake.gemspec -Style/LineLength: +Metrics/LineLength: Enabled: true Max: 120 @@ -16,31 +16,31 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes -Style/IndentationWidth: +Layout/IndentationWidth: Enabled: true -Style/Tab: +Layout/Tab: Enabled: true -Style/EmptyLines: +Layout/EmptyLines: Enabled: true -Style/TrailingBlankLines: +Layout/TrailingBlankLines: Enabled: true -Style/TrailingWhitespace: +Layout/TrailingWhitespace: Enabled: true -Style/SpaceBeforeBlockBraces: +Layout/SpaceBeforeBlockBraces: Enabled: true -Style/SpaceInsideBlockBraces: +Layout/SpaceInsideBlockBraces: Enabled: true -Style/SpaceInsideHashLiteralBraces: +Layout/SpaceInsideHashLiteralBraces: Enabled: true -Style/CaseIndentation: +Layout/CaseIndentation: Enabled: true Style/MultilineIfThen: From d7baa00984168d4b1707573dee643115917f646f Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:23 +0900 Subject: [PATCH 4/5] Ordered --- .rubocop.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 25589b98c..29aa862a5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,6 +16,15 @@ Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes +Style/MultilineIfThen: + Enabled: true + +Style/MethodDefParentheses: + Enabled: true + +Style/BracesAroundHashParameters: + Enabled: true + Layout/IndentationWidth: Enabled: true @@ -43,15 +52,6 @@ Layout/SpaceInsideHashLiteralBraces: Layout/CaseIndentation: Enabled: true -Style/MultilineIfThen: - Enabled: true - -Style/MethodDefParentheses: - Enabled: true - -Style/BracesAroundHashParameters: - Enabled: true - Lint/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable From 879e08f34bdbb6f4236f8f2fe1f205b0199601d1 Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Mon, 21 Aug 2017 11:44:43 +0900 Subject: [PATCH 5/5] rubocop -a --- test/helper.rb | 2 +- test/test_rake_file_utils.rb | 2 +- test/test_rake_rake_test_loader.rb | 4 ++-- test/test_rake_rules.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/helper.rb b/test/helper.rb index a6e38cb18..17447ab2e 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true $:.unshift File.expand_path("../../lib", __FILE__) -require 'coveralls' +require "coveralls" Coveralls.wear! gem "minitest", "~> 5" diff --git a/test/test_rake_file_utils.rb b/test/test_rake_file_utils.rb index bfdaf75bd..90526b1d9 100644 --- a/test/test_rake_file_utils.rb +++ b/test/test_rake_file_utils.rb @@ -186,7 +186,7 @@ def test_sh_with_hash_option check_expansion verbose(false) { - sh "#{RUBY} check_expansion.rb", {chdir: "."}, { verbose: false } + sh "#{RUBY} check_expansion.rb", { chdir: "." }, verbose: false } end diff --git a/test/test_rake_rake_test_loader.rb b/test/test_rake_rake_test_loader.rb index fa35c44aa..fabee4721 100644 --- a/test/test_rake_rake_test_loader.rb +++ b/test/test_rake_rake_test_loader.rb @@ -6,7 +6,7 @@ class TestRakeRakeTestLoader < Rake::TestCase def setup super - @loader = File.join @rake_lib, 'rake/rake_test_loader.rb' + @loader = File.join @rake_lib, "rake/rake_test_loader.rb" end def test_pattern @@ -35,7 +35,7 @@ def test_load_error assert_empty out - no_such_path = File.join @tempdir, 'no_such_test_file' + no_such_path = File.join @tempdir, "no_such_test_file" expected = /\A\n diff --git a/test/test_rake_rules.rb b/test/test_rake_rules.rb index 739e35470..52934c258 100644 --- a/test/test_rake_rules.rb +++ b/test/test_rake_rules.rb @@ -11,7 +11,7 @@ class TestRakeRules < Rake::TestCase OBJFILE = "abc.o" FOOFILE = "foo" DOTFOOFILE = ".foo" - MINFILE = 'abc.min.o' + MINFILE = "abc.min.o" def setup super @@ -400,7 +400,7 @@ def obj.find_prereq(task_name) def test_works_with_chained_extensions_in_rules create_file(OBJFILE) - rule('.min.o' => ['.o']) do |t| + rule(".min.o" => [".o"]) do |t| @runs << t.name assert_equal OBJFILE, t.source assert_equal MINFILE, t.name