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

No longer raise a RuntimeError if an input file was not formatted wel… #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion bin/gherkin_format
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ if options.key? :template
exit 0
end

exit_code = 0

ARGV.each do |file|
formatter.format file, options
begin
formatter.format file, options
rescue StandardError => e
puts e.message
exit_code = 1
end
end

exit exit_code
4 changes: 1 addition & 3 deletions lib/gherkin_format.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def format(file, options = {})
return if input == output

File.write(file, output) if options.key? :replace

puts "File #{file} is not formatted well."
raise "File #{file} is not formatted well."
raise "File #{file} was not formatted well."
end

def render(template, files)
Expand Down