Skip to content

Commit 07495d8

Browse files
committed
Fix Rubocop offenses
1 parent 68b1812 commit 07495d8

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/html_proofer/runner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def checks
200200
end
201201

202202
def failed_checks
203-
@reporter.failures.flatten.select { |f| f.is_a?(Failure) }
203+
@reporter.failures.flatten.grep(Failure)
204204
end
205205

206206
def report_failed_checks

lib/html_proofer/url_validator/internal.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def run_internal_link_checker(links)
118118

119119
# For hash links, we need to defer to file-based checking
120120
# (even if URL doesn't have extension, it may resolve to index.html)
121-
return nil unless url.has_hash?
121+
return unless url.has_hash? # rubocop:disable Style/ReturnNilInPredicateMethodDefinition
122122

123123
# If URL has no known extension, defer to file-based checking
124-
return nil unless url.known_extension?
124+
return unless url.known_extension? # rubocop:disable Style/ReturnNilInPredicateMethodDefinition
125125

126126
decoded_href_hash = Addressable::URI.unescape(href_hash)
127127
fragment_ids = [href_hash, decoded_href_hash]

spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def capture_proofer_http(item, type, opts = {})
7070
end
7171

7272
def make_bin(args)
73-
ap("#{RbConfig.ruby} exe/htmlproofer #{args}") if debug?
7473
stdout, stderr = Open3.capture3("#{RbConfig.ruby} exe/htmlproofer #{args}")
7574
# Filter out Ruby experimental warnings (e.g., IO::Buffer in Ruby 4.0)
7675
stderr = stderr.lines.reject { |line| line.include?("warning:") && line.include?("experimental") }.join

0 commit comments

Comments
 (0)