Bump Rubocop to 0.49.1 (#6093)

Merge pull request 6093
This commit is contained in:
Anatoliy Yastreb 2017-06-15 21:29:35 +09:00 committed by jekyllbot
parent 2c0f5b3059
commit d3b00cb84c
14 changed files with 57 additions and 58 deletions

View File

@ -9,6 +9,38 @@ AllCops:
- benchmark/**/*
- script/**/*
- vendor/**/*
Layout/AlignArray:
Enabled: false
Layout/AlignHash:
EnforcedHashRocketStyle: table
Layout/AlignParameters:
Enabled: false
Layout/EmptyLinesAroundAccessModifier:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EndOfLine:
EnforcedStyle: lf
Layout/ExtraSpacing:
AllowForAlignment: true
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/IndentationWidth:
Severity: error
Layout/IndentArray:
EnforcedStyle: consistent
Layout/IndentHash:
EnforcedStyle: consistent
Layout/IndentHeredoc:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceInsideBrackets:
Enabled: false
Lint/EndAlignment:
Severity: error
Lint/UnreachableCode:
@ -59,13 +91,6 @@ Security/YAMLLoad:
- !ruby/regexp /test\/.*.rb$/
Style/Alias:
Enabled: false
Style/AlignArray:
Enabled: false
Style/AlignHash:
EnforcedHashRocketStyle: table
Style/AlignParameters:
Enabled: false
EnforcedStyle: with_fixed_indentation
Style/AndOr:
Severity: error
Style/Attr:
@ -80,18 +105,8 @@ Style/Documentation:
- !ruby/regexp /features\/.*.rb$/
Style/DoubleNegation:
Enabled: false
Style/EmptyLinesAroundAccessModifier:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/EndOfLine:
EnforcedStyle: lf
Style/ExtraSpacing:
AllowForAlignment: true
Style/FileName:
Enabled: false
Style/FirstParameterIndentation:
EnforcedStyle: consistent
Style/GuardClause:
Enabled: false
Style/HashSyntax:
@ -99,22 +114,10 @@ Style/HashSyntax:
Severity: error
Style/IfUnlessModifier:
Enabled: false
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:
EnforcedStyle: indented
Style/MultilineOperationIndentation:
EnforcedStyle: indented
Style/MultilineTernaryOperator:
Severity: error
Style/PercentLiteralDelimiters:
@ -138,10 +141,6 @@ Style/SignalException:
EnforcedStyle: only_raise
Style/SingleLineMethods:
Enabled: false
Style/SpaceAroundOperators:
Enabled: false
Style/SpaceInsideBrackets:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:

View File

@ -25,7 +25,7 @@ group :test do
gem "nokogiri"
gem "rspec"
gem "rspec-mocks"
gem "rubocop", "~> 0.48.1"
gem "rubocop", "~> 0.49.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__))

View File

@ -34,7 +34,7 @@ module Jekyll
if docs.respond_to?(method.to_sym)
Jekyll.logger.warn "Deprecation:",
"#{label}.#{method} should be changed to #{label}.docs.#{method}."
Jekyll.logger.warn "", "Called by #{caller.first}."
Jekyll.logger.warn "", "Called by #{caller(0..0)}."
docs.public_send(method.to_sym, *args, &blck)
else
super

View File

@ -136,7 +136,7 @@ module Jekyll
private
def format_url(ssl_enabled, address, port, baseurl = nil)
format("%{prefix}://%{address}:%{port}%{baseurl}", {
format("%<prefix>s://%<address>s:%<port>i%<baseurl>s", {
:prefix => ssl_enabled ? "https" : "http",
:address => address,
:port => port,

View File

@ -8,7 +8,7 @@ module Jekyll
#
# Returns the String prefix.
def self.highlighter_prefix(highlighter_prefix = nil)
if !defined?(@highlighter_prefix) || !highlighter_prefix.nil?
unless defined?(@highlighter_prefix) && highlighter_prefix.nil?
@highlighter_prefix = highlighter_prefix
end
@highlighter_prefix
@ -22,7 +22,7 @@ module Jekyll
#
# Returns the String suffix.
def self.highlighter_suffix(highlighter_suffix = nil)
if !defined?(@highlighter_suffix) || !highlighter_suffix.nil?
unless defined?(@highlighter_suffix) && highlighter_suffix.nil?
@highlighter_suffix = highlighter_suffix
end
@highlighter_suffix

View File

@ -160,7 +160,7 @@ module Jekyll
#
# Returns true if extname == .coffee, false otherwise.
def coffeescript_file?
".coffee" == ext
ext == ".coffee"
end
# Determine whether the file should be rendered with Liquid.

View File

@ -150,7 +150,7 @@ module Jekyll
#
# Returns true if extname == .coffee, false otherwise.
def coffeescript_file?
".coffee" == extname
extname == ".coffee"
end
# Determine whether the file should be rendered with Liquid.
@ -371,7 +371,7 @@ module Jekyll
if data.key?(method.to_s)
Jekyll::Deprecator.deprecation_message "Document##{method} is now a key "\
"in the #data hash."
Jekyll::Deprecator.deprecation_message "Called by #{caller.first}."
Jekyll::Deprecator.deprecation_message "Called by #{caller(0..0)}."
data[method.to_s]
else
super

View File

@ -60,7 +60,7 @@ module Jekyll
#
# Returns the safety Boolean.
def self.safe(safe = nil)
if !defined?(@safe) || !safe.nil?
unless defined?(@safe) && safe.nil?
@safe = safe
end
@safe || false