Bump RuboCop to v1.45.x (#9305)

Merge pull request 9305
This commit is contained in:
Ashwin Maroli 2023-02-16 17:56:21 +05:30 committed by GitHub
parent 66e6b2f2d3
commit 4ecbeb4063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -447,6 +447,7 @@ Style/RescueModifier:
Style/SafeNavigation: Style/SafeNavigation:
Exclude: Exclude:
- lib/jekyll/document.rb - lib/jekyll/document.rb
- lib/jekyll/page.rb
Style/SignalException: Style/SignalException:
EnforcedStyle: only_raise EnforcedStyle: only_raise
Style/SingleArgumentDig: Style/SingleArgumentDig:

View File

@ -23,7 +23,7 @@ group :test do
gem "nokogiri", "~> 1.7" gem "nokogiri", "~> 1.7"
gem "rspec" gem "rspec"
gem "rspec-mocks" gem "rspec-mocks"
gem "rubocop", "~> 1.38.0" gem "rubocop", "~> 1.45.0"
gem "rubocop-minitest" gem "rubocop-minitest"
gem "rubocop-performance" gem "rubocop-performance"
gem "rubocop-rake" gem "rubocop-rake"

View File

@ -4,7 +4,9 @@ module Jekyll
class StaticFile class StaticFile
extend Forwardable extend Forwardable
attr_reader :relative_path, :extname, :name attr_reader :relative_path, :extname,
:type, # Returns the type of the collection if present, nil otherwise.
:name
def_delegator :to_liquid, :to_json, :to_json def_delegator :to_liquid, :to_json, :to_json
@ -34,6 +36,7 @@ module Jekyll
@collection = collection @collection = collection
@relative_path = File.join(*[@dir, @name].compact) @relative_path = File.join(*[@dir, @name].compact)
@extname = File.extname(@name) @extname = File.extname(@name)
@type = @collection&.label&.to_sym
end end
# rubocop: enable Metrics/ParameterLists # rubocop: enable Metrics/ParameterLists
@ -171,11 +174,6 @@ module Jekyll
end end
end end
# Returns the type of the collection if present, nil otherwise.
def type
@type ||= @collection.nil? ? nil : @collection.label.to_sym
end
# Returns the front matter defaults defined for the file's URL and/or type # Returns the front matter defaults defined for the file's URL and/or type
# as defined in _config.yml. # as defined in _config.yml.
def defaults def defaults