Skip to content

Commit 05a5763

Browse files
authored
fix increasing indent on error tracebacks (#60)
1 parent 533d738 commit 05a5763

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

lib/quickdraw/runner.rb

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ def call
4949
@errors.each do |error|
5050
puts
5151

52-
[
53-
"\e[4m#{error['location'][0]}:#{error['location'][1]}\e[0m",
54-
"\e[1m#{(error['description'])}\e[0m",
55-
"\e[3munexpected \e[1m#{error['name']}\e[0m",
56-
error["message"],
57-
*error["backtrace"]
58-
.take_while { |it| @backtrace || !it.include?('Quickdraw::Runner') }
59-
.map { |it| it.gsub(":in `", " in `") },
60-
].each_with_index do |line, i|
61-
puts "#{' ' * i}#{line}"
62-
end
52+
puts "\e[4m#{error['location'][0]}:#{error['location'][1]} #{error['description']}\e[0m"
53+
puts "\e[3m unexpected \e[1m#{error['name']}: #{error['message']}\e[0m"
54+
error["backtrace"]
55+
.take_while { |it| @backtrace || !it.include?("Quickdraw::Runner") }
56+
.map { |it| it.gsub(":in `", " in `") }
57+
.each do |line|
58+
puts line
59+
end
6360
end
6461

6562
@failures.each do |failure|

0 commit comments

Comments
 (0)