prontolabs / pronto-rubocop

Pronto runner for Rubocop, ruby code analyzer
MIT License
83 stars 74 forks source link

Filter out duplicate Pronto Messages on the same line. #8

Closed edk closed 9 years ago

edk commented 9 years ago

Hi!

First, thank you for the awesome tool. Pronto and the associated plugins are very helpful.

I'd like your feedback on this problem I'm having. The team I'm on is working with a large legacy codebase, and I started using pronto to help guide us towards better code.

However, when a single line contains multiple offenses that are the same, it's unnecessary noise and in an extreme case, causes the github pull request page to fail to load with the angry unicorn (600+ comments can be an effective DOS)

It probably sounds far-fetched, but a large pull request with things like:

 [:multiple,:symbols,:in,:a,:very,:long,:line]

will generate the same comment over and over.

This PR is my attempt to remove offenses with the same exact message, per line.

Any feedback appreciated, and thanks again.

mmozuras commented 9 years ago

Valid complaint. When there are multiple issues of the same kind in a single line, it shouldn't spam that much. Though, I'd like to handle it in https://github.com/mmozuras/pronto and not here. I'm also trying to decide whether it should work the same with all formatters. It's not great with github/github_pr, but maybe, it's desirable with text/json?

edk commented 9 years ago

OK, sounds good. I didn't think about the other formatters, but you're right -- dropping duplicates only makes sense for the github format.

I can try to take a stab at it in the main project in the next day or two, if you like.

mmozuras commented 9 years ago

@edk sure, go ahead :smile: