Skip to content

Fix sorting of report entries

Martin Vidner requested to merge mvidner:report-entry-comparable into master

I noticed that report entries were sorted by line numbers within a file, but the files were sometimes intermixed:

RichText.rb: error: line 43, column 7: undefined method CutBlanks on String
URLRecode.rb: error: line 55, column 5: undefined method publish
URLRecode.rb: error: line 56, column 5: undefined method publish
URLRecode.rb: error: line 57, column 5: undefined method publish
URLRecode.rb: error: line 58, column 5: undefined method publish
URLRecode.rb: warning: line 61, column 3: unused constant URLRecode
RichText.rb: error: line 93, column 19: undefined method CutBlanks on String
RichText.rb: error: line 108, column 16: undefined method CutBlanks on String
RichText.rb: error: line 139, column 5: undefined method publish
RichText.rb: error: line 140, column 5: undefined method publish

It turns out that RubyLint::Report::Entry#<=>, and its tests, were wrong. This fixes it.

Merge request reports