Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making runner return the array of failures to enable file export #523

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Making runner return the array of failures to enable file export
  • Loading branch information
J Mat Trang committed Jul 4, 2019
commit 7ae53016ffb3d9d31f2526ac3480297a1703ccdb
4 changes: 1 addition & 3 deletions lib/html-proofer/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ def print_failed_tests
sorted_failures = SortedIssues.new(@failures, @options[:error_sort], @logger)

sorted_failures.sort_and_report
count = @failures.length
failure_text = pluralize(count, 'failure', 'failures')
raise @logger.colorize :red, "HTML-Proofer found #{failure_text}!"
return @failures
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but you are removing the existing use case of printing errors on the command line for the sake of your specific use case of iterating over the failures in a script.

An option should be passed to enable the returning of these failures, or at least some TTY detection to note that when this is run from the terminal, the logging is the option.

end
end
end