Bump Rubocop to version 1.48.x (#9326)

Merge pull request 9326
This commit is contained in:
waqarnazir 2023-03-26 14:05:10 +05:00 committed by GitHub
parent 8c8c88eec0
commit 6bedc7e069
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -368,7 +368,7 @@ Style/GuardClause:
Style/HashAsLastArrayItem: Style/HashAsLastArrayItem:
Enabled: true Enabled: true
Style/HashConversion: Style/HashConversion:
Enabled: true Enabled: true
Style/HashEachMethods: Style/HashEachMethods:
Enabled: true Enabled: true
Style/HashExcept: Style/HashExcept:
@ -392,6 +392,8 @@ Style/MapCompactWithConditionalBlock:
Enabled: true Enabled: true
Style/MapToHash: Style/MapToHash:
Enabled: true Enabled: true
Style/MinMaxComparison:
Enabled: true
Style/MixinUsage: Style/MixinUsage:
Exclude: Exclude:
- test/helper.rb - test/helper.rb

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.45.0" gem "rubocop", "~> 1.48.0"
gem "rubocop-minitest" gem "rubocop-minitest"
gem "rubocop-performance" gem "rubocop-performance"
gem "rubocop-rake" gem "rubocop-rake"

View File

@ -486,7 +486,7 @@ module Jekyll
# Returns nothing # Returns nothing
def limit_posts! def limit_posts!
if limit_posts.positive? if limit_posts.positive?
limit = posts.docs.length < limit_posts ? posts.docs.length : limit_posts limit = [posts.docs.length, limit_posts].min
posts.docs = posts.docs[-limit, limit] posts.docs = posts.docs[-limit, limit]
end end
end end