Bump Rubocop to v0.48 (#5997)

Merge pull request 5997
This commit is contained in:
ashmaroli 2017-04-09 16:54:45 +05:30 committed by jekyllbot
parent a83b668409
commit 7d7a312b33
13 changed files with 39 additions and 21 deletions

View File

@ -35,6 +35,8 @@ Metrics/LineLength:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
- Gemfile
- jekyll.gemspec
Max: 90
Severity: warning
Metrics/MethodLength:
@ -82,6 +84,8 @@ Style/EmptyLinesAroundAccessModifier:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/EndOfLine:
EnforcedStyle: lf
Style/ExtraSpacing:
AllowForAlignment: true
Style/FileName:
@ -99,8 +103,12 @@ Style/IndentArray:
EnforcedStyle: consistent
Style/IndentHash:
EnforcedStyle: consistent
Style/IndentHeredoc:
Enabled: false
Style/IndentationWidth:
Severity: error
Style/InverseMethods:
Enabled: false
Style/ModuleFunction:
Enabled: false
Style/MultilineMethodCallIndentation:
@ -138,6 +146,8 @@ Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/SymbolArray:
Enabled: false
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/UnneededCapitalW:

View File

@ -25,9 +25,9 @@ group :test do
gem "nokogiri"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.47.1"
gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "rubocop", "~> 0.48.1"
gem "test-dependency-theme", :path => File.expand_path("./test/fixtures/test-dependency-theme", File.dirname(__FILE__))
gem "test-theme", :path => File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
end
@ -77,9 +77,9 @@ group :jekyll_optional_dependencies do
gem "classifier-reborn", "~> 2.1.0"
gem "liquid-c", "~> 3.0"
gem "pygments.rb", "~> 0.6.0"
gem "yajl-ruby", "~> 1.2"
gem "rdiscount", "~> 2.0"
gem "redcarpet", "~> 3.2", ">= 3.2.3"
gem "yajl-ruby", "~> 1.2"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem

View File

@ -106,7 +106,7 @@ def siteify_file(file, overrides_front_matter = {})
front_matter = {
"title" => title,
"permalink" => "/docs/#{slug}/",
"note" => "This file is autogenerated. Edit /#{file} instead."
"note" => "This file is autogenerated. Edit /#{file} instead.",
}.merge(overrides_front_matter)
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
File.write("#{docs_folder}/_docs/#{slug}.md", contents)

View File

@ -1,4 +1,5 @@
# coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "jekyll/version"

View File

@ -1,4 +1,5 @@
# encoding: UTF-8
require "csv"
module Jekyll

View File

@ -1,4 +1,5 @@
# encoding: UTF-8
require "csv"
module Jekyll

View File

@ -1,11 +1,11 @@
Gem::Specification.new do |s|
s.name = 'test-dependency-theme'
s.version = '0.1.0'
s.licenses = ['MIT']
s.name = "test-dependency-theme"
s.version = "0.1.0"
s.licenses = ["MIT"]
s.summary = "This is another theme used to test Jekyll"
s.authors = ["Jekyll"]
s.files = ["lib/example.rb"]
s.homepage = 'https://github.com/jekyll/jekyll'
s.homepage = "https://github.com/jekyll/jekyll"
s.add_runtime_dependency "jekyll_test_plugin"
end

View File

@ -1,9 +1,9 @@
Gem::Specification.new do |s|
s.name = 'test-theme'
s.version = '0.1.0'
s.licenses = ['MIT']
s.name = "test-theme"
s.version = "0.1.0"
s.licenses = ["MIT"]
s.summary = "This is a theme used to test Jekyll"
s.authors = ["Jekyll"]
s.files = ["lib/example.rb"]
s.homepage = 'https://github.com/jekyll/jekyll'
s.homepage = "https://github.com/jekyll/jekyll"
end

View File

@ -217,7 +217,9 @@ class TestCollections < JekyllUnitTest
end
should "read document in subfolders with dots" do
assert @collection.docs.any? { |d| d.path.include?("all.dots") }
assert(
@collection.docs.any? { |d| d.path.include?("all.dots") }
)
end
end
end

View File

@ -424,9 +424,9 @@ class TestDocument < JekyllUnitTest
context "with output overrides" do
should "be output according its front matter" do
assert_nil @files.find { |doc|
doc.relative_path == "_slides/non-outputted-slide.html"
}
assert_nil(
@files.find { |doc| doc.relative_path == "_slides/non-outputted-slide.html" }
)
end
end
end

View File

@ -184,8 +184,8 @@ class TestFrontMatterDefaults < JekyllUnitTest
should "parse date" do
@site.process
date = Time.parse("2015-01-01 00:00:01")
assert @site.pages.find { |page| page.data["date"] == date }
assert @site.posts.find { |page| page.data["date"] == date }
assert(@site.pages.find { |page| page.data["date"] == date })
assert(@site.posts.find { |page| page.data["date"] == date })
end
end
end

View File

@ -52,9 +52,11 @@ class TestGeneratedSite < JekyllUnitTest
end
should "include a post with a abbreviated dates" do
refute_nil @site.posts.index { |post|
post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
}
refute_nil(
@site.posts.index do |post|
post.relative_path == "_posts/2017-2-5-i-dont-like-zeroes.md"
end
)
assert_exist dest_dir("2017", "02", "05", "i-dont-like-zeroes.html")
end

View File

@ -1,4 +1,5 @@
# coding: utf-8
require "helper"
class TestTags < JekyllUnitTest