ashfurrow / danger-ruby-swiftlint

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

Remove unary plus operator from message string. #120

Closed sxcore closed 5 years ago

sxcore commented 5 years ago

trivial resolves #119

ashfurrow commented 5 years ago

Ah, I know what the CI failure is. Hold on...

sxcore commented 5 years ago

I hope my change was not so bad to fail 18 test cases.

ashfurrow commented 5 years ago

Hmm okay, so it looks like the unary + operator was added in Ruby 2.3.0 to "unfreeze" strings, which was added for a whole "frozen string literals" thing. It's kinda complicated, but I think I can get it to work with newer and older Ruby versions...

sxcore commented 5 years ago

I am wondering, is it worth to support older Ruby versions? I am from iOS Development background so I am not fully aware how backwards compatibility should be handled. EDIT: But I see that everything is working back, even on CI :)

ashfurrow commented 5 years ago

@Drwalcore that's a good question without a simple answer. Ruby doesn't have a compiler so we rely on unit tests to provide confidence in the code that a compiler would normally provide. On the other hand, Ruby doesn't have the Swift-style "if this version of Swift else if this version" kind of syntax. (Well, it might have it but I don't use it.)

A more robust CI suite would run the tests against multiple "officially supported" Ruby versions, which is kind of overkill for this project imo. Switching from unary + to .dup (for "duplicate") is a pretty small change to keep support for older Ruby versions, so let's do that 👍

peril-staging[bot] commented 5 years ago

Danger run resulted in 1 fail and 2 markdowns; to find out more, see the checks page.

Generated by :no_entry_sign: dangerJS

ashfurrow commented 5 years ago

Okay, I've released version 0.18.1 with this change. You should be able to bundle update danger-swiftlint to get the changes.