Skip to content

Enable suggestions when a line has multiple offenses#70

Merged
ashkulz merged 2 commits intoprontolabs:masterfrom
letmein:handle-lines-with-multiple-offenses
Oct 8, 2021
Merged

Enable suggestions when a line has multiple offenses#70
ashkulz merged 2 commits intoprontolabs:masterfrom
letmein:handle-lines-with-multiple-offenses

Conversation

@letmein
Copy link
Copy Markdown
Contributor

@letmein letmein commented Oct 7, 2021

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:

And it will give a false positive in the following guard condition:

return if differing_lines_count != corrections_count

I changed it to count only unique line numbers that contain offences, so the count of corrections matches differing_lines_count.

@letmein letmein requested a review from a team as a code owner October 7, 2021 11:42
@ashkulz
Copy link
Copy Markdown
Member

ashkulz commented Oct 8, 2021

@letmein can you change this line to 2.5 so that the tests will pass?

@letmein
Copy link
Copy Markdown
Contributor Author

letmein commented Oct 8, 2021

@ashkulz done

@ashkulz ashkulz merged commit 2dc440f into prontolabs:master Oct 8, 2021
@ashkulz
Copy link
Copy Markdown
Member

ashkulz commented Oct 8, 2021

Thanks for the contribution, @letmein!

@ashkulz
Copy link
Copy Markdown
Member

ashkulz commented Jun 29, 2022

This has been pushed to RubyGems as 0.11.2 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants