Closed letmein closed 2 years ago
Hi!
I found that suggestions are not being added when a line has more than one offense.
For example, we need to enforce double quotes:
['a', 'b']
This line will be counted twice here: https://github.com/prontolabs/pronto-rubocop/blob/67d9cbf22acfa0ab7616339c66eed02f3ae0832d/lib/pronto/rubocop/offense_line.rb#L69
And it will give a false positive in the following guard condition: https://github.com/prontolabs/pronto-rubocop/blob/67d9cbf22acfa0ab7616339c66eed02f3ae0832d/lib/pronto/rubocop/offense_line.rb#L37
I changed it to count only unique line numbers that contain offences, so the count of corrections matches differing_lines_count.
differing_lines_count
@letmein can you change this line to 2.5 so that the tests will pass?
@ashkulz done
Thanks for the contribution, @letmein!
This has been pushed to RubyGems as 0.11.2 :tada:
0.11.2
Hi!
I found that suggestions are not being added when a line has more than one offense.
For example, we need to enforce double quotes:
This line will be counted twice here: https://github.com/prontolabs/pronto-rubocop/blob/67d9cbf22acfa0ab7616339c66eed02f3ae0832d/lib/pronto/rubocop/offense_line.rb#L69
And it will give a false positive in the following guard condition: https://github.com/prontolabs/pronto-rubocop/blob/67d9cbf22acfa0ab7616339c66eed02f3ae0832d/lib/pronto/rubocop/offense_line.rb#L37
I changed it to count only unique line numbers that contain offences, so the count of corrections matches
differing_lines_count
.