ashfurrow / danger-ruby-swiftlint

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

Lint error for "masterCard" inclusive_language #165

Closed apps4everyone closed 3 years ago

apps4everyone commented 3 years ago

On local Xcode Setup (https://github.com/realm/SwiftLint 0.43.1) the inclusive_language has masterCard in the allowance list.

But on CI I get: Declaration masterCard contains the term "master" which is not considered inclusive.

for: case masterCard = "MASTERCARD"

apps4everyone commented 3 years ago

.swiftlint.yml:

inclusive_language:
  override_allowed_terms: ["mastercard", "MASTERCARD"]
mokagio commented 3 years ago

I'd say this is safe to close. I haven't searched for those usages, but being in the override_allowed_terms list, they clearly represent an intentional compromise.

apps4everyone commented 3 years ago

Hey, thx for the fast reply. Tested with disabling: - inclusive_language and the error is gone on CI.

What version of https://github.com/realm/SwiftLint is used as binary or what is the default path for swiftlint.binary_path?

apps4everyone commented 3 years ago

Looks like the problem is the outdated version: 0.41.0 here: https://github.com/ashfurrow/danger-ruby-swiftlint/blob/77360835f4a6d5bb87678ee5865a0c0255a1361a/lib/version.rb#L5 and Mastercard was fixed with 0.42.0 see here: https://github.com/realm/SwiftLint/blob/master/CHANGELOG.md#0420-he-chutes-he-scores

Latest version: https://github.com/realm/SwiftLint/releases/tag/0.43.1

apps4everyone commented 3 years ago

best would be to add the functionality to specify the version in the danger file e.g.: swiftlint.swiftlint_version = '0.43.1' and use by default the latest?

ashfurrow commented 3 years ago

You can set the SWIFTLINT_VERSION environment variable to whatever you want, and danger-swiftlint will install that version. The version we specify in version.rb is a fallback if you don't specific one with the SWIFTLINT_VERSION env var.

mokagio commented 3 years ago

@apps4everyone thank you for your research work 😄

Sounds like you've done most of the hard work already, how would you feel about opening a PR that updates the fallback version to the latest stable SwiftLint to see if everything works fine with that?