Skip to content

Commit

Permalink
Bump Rubocop to v0.48 (#5997)
Browse files Browse the repository at this point in the history
Merge pull request 5997
  • Loading branch information
ashmaroli authored and jekyllbot committed Apr 9, 2017
1 parent a83b668 commit 7d7a312
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Metrics/LineLength:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
- Gemfile
- jekyll.gemspec
Max: 90
Severity: warning
Metrics/MethodLength:
Expand Down Expand Up @@ -82,6 +84,8 @@ Style/EmptyLinesAroundAccessModifier:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/EndOfLine:
EnforcedStyle: lf
Style/ExtraSpacing:
AllowForAlignment: true
Style/FileName:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions jekyll.gemspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions lib/jekyll/reader.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8

require "csv"

module Jekyll
Expand Down
1 change: 1 addition & 0 deletions lib/jekyll/site.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8

require "csv"

module Jekyll
Expand Down
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions test/fixtures/test-theme/test-theme.gemspec
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion test/test_collections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions test/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ def assert_equal_value(key, one, other)

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
Expand Down
4 changes: 2 additions & 2 deletions test/test_front_matter_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions test/test_generated_site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions test/test_tags.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8

require "helper"

class TestTags < JekyllUnitTest
Expand Down

0 comments on commit 7d7a312

Please sign in to comment.