lib/danger/request_sources/github/github.rb in danger-5.5.11 vs lib/danger/request_sources/github/github.rb in danger-5.5.12
- old
+ new
@@ -463,11 +463,10 @@
# @return [String] A URL to the specific file, ready to be downloaded
def file_url(organisation: nil, repository: nil, branch: nil, path: nil)
organisation ||= self.organisation
- return @download_url unless @download_url.nil?
begin
# Retrieve the download URL (default branch on nil param)
contents = client.contents("#{organisation}/#{repository}", path: path, ref: branch)
@download_url = contents["download_url"]
rescue Octokit::ClientError
@@ -488,11 +487,11 @@
}
end
def inline_violations_group(warnings: [], errors: [], messages: [], markdowns: [])
cmp = proc do |a, b|
- next -1 unless a.file
- next 1 unless b.file
+ next -1 unless a.file && a.line
+ next 1 unless b.file && b.line
next a.line <=> b.line if a.file == b.file
next a.file <=> b.file
end