danger / danger/danger

Danger crashes if multiple inline comments have same severity, file and line number

Open
#1,332 4 comments 2 reactions 0 assignees View on GitHub
Bug You Can Do This
Dominant language
Ruby
Stars
5.7k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

# Report

## What did you do?
While implementing support for [SwiftFormat plugin's inline_mode](https://github.com/garriguv/danger-ruby-swiftformat/pull/45), I noticed that if multiple plugins are trying to add inline_comment with the same severity to the same file and line, danger crashes with `lib/danger/request_sources/bitbucket_server.rb:158:in 'sort': comparison of Danger::Violation with Danger::Violation failed (ArgumentError)`.
Github seems to have the same sort.

https://github.com/danger/danger/blob/master/lib/danger/request_sources/bitbucket_server.rb#L158

## What did you expect to happen?

Expected danger not to crash, and all comments to be sorted out in any order.

## What happened instead?
💥

## Your Environment

Dangerfile
```ruby
swiftlint.lint_files(fail_on_error: true, inline_mode: true, additional_swiftlint_args: '--strict')
swiftformat.check_format(fail_on_error: true, inline_mode: true)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.