Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Dec 10, 2019
1 parent ac93f46 commit 891df75
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions Gemfile
@@ -1,4 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gem 'nokogumbo', git: 'https://github.com/rubys/nokogumbo'
Expand Down
2 changes: 1 addition & 1 deletion html-proofer.gemspec
Expand Up @@ -19,9 +19,9 @@ Gem::Specification.new do |gem|
gem.require_paths = ['lib']

gem.add_dependency 'addressable', '~> 2.3'
gem.add_dependency 'colorize', '~> 0.8'
gem.add_dependency 'mercenary', '~> 0.3'
gem.add_dependency 'nokogumbo', '~> 2.0'
gem.add_dependency 'colorize', '~> 0.8'
gem.add_dependency 'parallel', '~> 1.3'
gem.add_dependency 'rainbow', '~> 3.0'
gem.add_dependency 'typhoeus', '~> 1.3'
Expand Down
2 changes: 1 addition & 1 deletion lib/html-proofer.rb
Expand Up @@ -17,7 +17,7 @@ def require_all(path)
begin
require 'awesome_print'
require 'pry-byebug'
rescue LoadError; end # rubocop:disable Lint/HandleExceptions
rescue LoadError; end # rubocop:disable Lint/SuppressedException
module HTMLProofer
def self.check_file(file, options = {})
raise ArgumentError unless file.is_a?(String)
Expand Down
2 changes: 1 addition & 1 deletion lib/html-proofer/check/html.rb
Expand Up @@ -11,7 +11,7 @@ class HtmlCheck < ::HTMLProofer::Check
def run
@html.errors.each do |error|
add_issue(error.message, line: error.line) if report?(error.message)
end
end
end

def report?(message)
Expand Down
10 changes: 5 additions & 5 deletions lib/html-proofer/middleware.rb
Expand Up @@ -10,17 +10,17 @@ def initialize(failures)
end

def message
"HTML Validation errors (skip by adding `?proofer-ignore` to URL): \n#{@failures.join("\n")}"
"HTML Validation errors (skip by adding `?proofer-ignore` to URL): \n#{@failures.join("\n")}"
end
end

def self.options
@options ||= {
type: :file,
allow_missing_href: true, # Permitted in html5
allow_hash_href: true,
type: :file,
allow_missing_href: true, # Permitted in html5
allow_hash_href: true,
check_external_hash: true,
check_html: true,
check_html: true,
url_ignore: [/.*/] # Don't try to check local files exist
}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/html-proofer/url_validator.rb
Expand Up @@ -146,7 +146,7 @@ def response_handler(response, filenames)
href = response.request.base_url.to_s
method = response.request.options[:method]
response_code = response.code
response.body.gsub!("\x00", '')
response.body.delete!("\x00")

debug_msg = if filenames.nil?
"Received a #{response_code} for #{href}"
Expand Down
2 changes: 1 addition & 1 deletion spec/html-proofer/html_spec.rb
Expand Up @@ -63,7 +63,7 @@
expect(proofer.failed_tests).to eq []
end

it "allows single ampersand" do
it 'allows single ampersand' do
html = "#{FIXTURES_DIR}/html/single_amp.html"
proofer = run_proofer(html, :file, check_html: true, validation: { report_missing_names: true })
expect(proofer.failed_tests).to eq []
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -34,7 +34,7 @@ def capture_stderr(*)
$stdout = StringIO.new unless ENV['VERBOSE']
begin
yield
rescue RuntimeError # rubocop:disable Lint/HandleExceptions
rescue RuntimeError # rubocop:disable Lint/SuppressedException
ensure
$stderr = original_stderr
$stdout = original_stdout unless ENV['VERBOSE']
Expand Down

0 comments on commit 891df75

Please sign in to comment.