ashfurrow / danger-ruby-swiftlint

A Danger plugin for SwiftLint.
https://rubygems.org/gems/danger-swiftlint
MIT License
203 stars 80 forks source link

Fix `git_modified_lines` method #181

Closed dstranz closed 2 years ago

dstranz commented 2 years ago

What Update git_modified_lines method to properly parse multipart git diff

Why It looks like it wrongly counts modified lines when git diff has multiple parts with more lines matching

/^@@ .+\+(?<line_number>\d+),/ 
ashfurrow commented 2 years ago

Okay, I think that makes sense. Thanks for the PR. Could you describe what problem this is fixing, for my own understanding? Is it only mis-reported number of lines, or something more functional?

dstranz commented 2 years ago

Hello @ashfurrow 🤝

I have a problem with reporting issues when filter_issues_in_diff is set. Then in this line: https://github.com/ashfurrow/danger-ruby-swiftlint/blob/master/lib/danger_plugin.rb#L336 SwiftLint issues from the further part of the diff (and invalid line number) are excluded from the report.

ashfurrow-peril[bot] commented 2 years ago

Thanks a lot for contributing @dstranz! You've been invited to be a collaborator on this repo – no pressure to accept! If you'd like more information on what this means, check out the Moya contributor guidelines and feel free to reach out with any questions.

Generated by :no_entry_sign: dangerJS

ashfurrow commented 2 years ago

Thanks again for the PR! This has been released in version 0.30.2 👍