Skip to content

Commit 8217b2b

Browse files
committed
Fix style offenses
1 parent f056782 commit 8217b2b

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

.rubocop.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,14 @@ AllCops:
99
TargetRubyVersion: 2.7
1010
SuggestExtensions: false
1111

12-
Lint/ShadowingOuterLocalVariable:
12+
Layout/LineLength:
1313
Exclude:
1414
- lib/jekyll-archives.rb
15-
16-
# Remove once Jekyll core has dropped explicit support for Ruby 2.2
17-
Lint/SafeNavigationConsistency:
18-
Exclude:
1915
- lib/jekyll-archives/archive.rb
20-
21-
Metrics/BlockLength:
22-
Exclude:
2316
- test/**/*.rb
2417

25-
Metrics/LineLength:
18+
Metrics/BlockLength:
2619
Exclude:
27-
- lib/jekyll-archives.rb
28-
- lib/jekyll-archives/archive.rb
2920
- test/**/*.rb
3021

3122
Minitest/AssertKindOf:

lib/jekyll-archives.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def append_enabled_date_type(meta, type, posts)
133133
def date_attr_hash(posts, id)
134134
hash = Hash.new { |hsh, key| hsh[key] = [] }
135135
posts.each { |post| hash[post.date.strftime(id)] << post }
136-
hash.each_value { |posts| posts.sort!.reverse! }
136+
hash.each_value { |posts_in_hsh| posts_in_hsh.sort!.reverse! }
137137
hash
138138
end
139139
end

lib/jekyll-archives/archive.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ def url
7777
:permalink => nil
7878
).to_s
7979
rescue ArgumentError
80-
raise ArgumentError, "Template \"#{template}\" provided is invalid."
80+
raise ArgumentError, "Template #{template.inspect} provided is invalid."
8181
end
8282

8383
def permalink
84-
data&.is_a?(Hash) && data["permalink"]
84+
data.is_a?(Hash) && data["permalink"]
8585
end
8686

8787
# Produce a title object suitable for Liquid based on type of archive.
8888
#
8989
# Returns a String (for tag and category archives) and nil for
9090
# date-based archives.
9191
def title
92-
@title if @title.is_a? String
92+
@title if @title.is_a?(String)
9393
end
9494

9595
# Produce a date object if a date-based archive

script/fmt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
set -e
33

4-
echo "Rubocop $(bundle exec rubocop --version)"
5-
bundle exec rubocop -S -D -E $@
4+
echo "RuboCop $(bundle exec rubocop --version)"
5+
bundle exec rubocop -E --disable-pending-cops $@
66
success=$?
77
if ((success != 0)); then
88
echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"

0 commit comments

Comments
 (0)