From fc0fe7e6eac99121d5274cbd10f3812efd59bb25 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Wed, 18 Oct 2017 22:10:04 -0500 Subject: [PATCH] Update Rubocop to 0.51.0 Fixes #6441 --- .rubocop.yml | 4 +--- Gemfile | 2 +- features/step_definitions.rb | 6 +++--- lib/jekyll/commands/build.rb | 2 +- lib/jekyll/configuration.rb | 2 +- lib/jekyll/converters/markdown/redcarpet_parser.rb | 2 +- test/test_filters.rb | 1 - test/test_kramdown.rb | 1 - test/test_tags.rb | 1 - test/test_utils.rb | 1 - 10 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8f961cf589f..f483e1ddc3a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ --- AllCops: - TargetRubyVersion: 2.0 + TargetRubyVersion: 2.1 Include: - lib/**/*.rb Exclude: @@ -117,8 +117,6 @@ Style/Documentation: - !ruby/regexp /features\/.*.rb$/ Style/DoubleNegation: Enabled: false -Style/Encoding: - EnforcedStyle: when_needed Style/GuardClause: Enabled: false Style/HashSyntax: diff --git a/Gemfile b/Gemfile index 8ff6d132570..92f6f45e54e 100644 --- a/Gemfile +++ b/Gemfile @@ -30,7 +30,7 @@ group :test do gem "nokogiri", RUBY_VERSION >= "2.2" ? "~> 1.7" : "~> 1.7.0" gem "rspec" gem "rspec-mocks" - gem "rubocop", "~> 0.50.0" + gem "rubocop", "~> 0.51.0" gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__) gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__) diff --git a/features/step_definitions.rb b/features/step_definitions.rb index 29900491989..c69cc0891d3 100644 --- a/features/step_definitions.rb +++ b/features/step_definitions.rb @@ -156,7 +156,7 @@ When(%r!^I run jekyll(.*)$!) do |args| run_jekyll(args) if args.include?("--verbose") || ENV["DEBUG"] - $stderr.puts "\n#{jekyll_run_output}\n" + warn "\n#{jekyll_run_output}\n" end end @@ -165,7 +165,7 @@ When(%r!^I run bundle(.*)$!) do |args| run_bundle(args) if args.include?("--verbose") || ENV["DEBUG"] - $stderr.puts "\n#{jekyll_run_output}\n" + warn "\n#{jekyll_run_output}\n" end end @@ -174,7 +174,7 @@ When(%r!^I run gem(.*)$!) do |args| run_rubygem(args) if args.include?("--verbose") || ENV["DEBUG"] - $stderr.puts "\n#{jekyll_run_output}\n" + warn "\n#{jekyll_run_output}\n" end end diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index 1bd176b8be4..96a48cdfd6c 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -96,7 +96,7 @@ def watch(site, options) ) end end - end # end of class << self + end end end end diff --git a/lib/jekyll/configuration.rb b/lib/jekyll/configuration.rb index 5c502d6816e..575dca6503b 100644 --- a/lib/jekyll/configuration.rb +++ b/lib/jekyll/configuration.rb @@ -207,7 +207,7 @@ def read_config_files(files) rescue ArgumentError => err Jekyll.logger.warn "WARNING:", "Error reading configuration. " \ "Using defaults (and options)." - $stderr.puts err + warn err end configuration.fix_common_issues.backwards_compatibilize.add_default_collections diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index 35c6e5feef7..7a8c6ec5923 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -47,7 +47,7 @@ def block_code(code, lang) end module WithRouge - def block_code(code, lang) + def block_code(_code, lang) code = "
#{super}
" "
#{add_code_tags(code, lang)}
" diff --git a/test/test_filters.rb b/test/test_filters.rb index 0499b73c2df..588a1f30e33 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -1,4 +1,3 @@ -# coding: utf-8 # frozen_string_literal: true require "helper" diff --git a/test/test_kramdown.rb b/test/test_kramdown.rb index e1bf15a4b4e..2a12a09074b 100644 --- a/test/test_kramdown.rb +++ b/test/test_kramdown.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 # frozen_string_literal: true require "helper" diff --git a/test/test_tags.rb b/test/test_tags.rb index 8a7ed7d0e6e..43d83464362 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -1,4 +1,3 @@ -# coding: utf-8 # frozen_string_literal: true require "helper" diff --git a/test/test_utils.rb b/test/test_utils.rb index 7d728a89292..01c1d98c613 100644 --- a/test/test_utils.rb +++ b/test/test_utils.rb @@ -1,4 +1,3 @@ -# encoding: utf-8 # frozen_string_literal: true require "helper"