lib/danger/request_sources/github/github.rb in danger-4.3.0 vs lib/danger/request_sources/github/github.rb in danger-4.3.1
- old
+ new
@@ -351,11 +351,14 @@
# file_line is set once we find the hunk the line is in
# we need to count how many lines in new file we have
# so we do it one by one ignoring the deleted lines
if !file_line.nil? && !line.start_with?("-")
- break if file_line == message.line
+ if file_line == message.line
+ file_line = nil if dismiss_out_of_range_messages && !line.start_with("+")
+ break
+ end
file_line += 1
end
# We need to count how many diff lines are between us and
# the line we're looking for
@@ -370,10 +373,10 @@
range_end = range_start
end
# We are past the line position, just abort
break if message.line.to_i < range_start
- next unless message.line.to_i >= range_start && message.line.to_i <= range_end
+ next unless message.line.to_i >= range_start && message.line.to_i < range_end
file_line = range_start
end
position unless file_line.nil?