We have a project that deals with payments provided by Mastercard and as such it is common to have code such as:
let mastercard = newWalletItem(for: .mastercard)
This triggers a violation of the inclusive_language
rule as the identifier contains a triggering term as a substring.
Is it possible to the break triggering terms in identifiers using camel case so let masterThread
is a violation but let mastercard
is not?
N/A
Paste your configuration file:
N/A - Default rule
Are you using nested configurations?
N/A
Which Xcode version are you using (check xcodebuild -version
)?
Xcode 12.1
Do you have a sample that shows the issue?
// This triggers a violation:
`let mastercard = newWalletItem(for: .mastercard)`
public enum WalletItemType: String {
case visa = "VISA"
// This triggers a violation:
case mastercard = "MASTERCARD"
}
Thanks for the report. @daltonclaybrook do you think you could build in tokenization based on camel/snake casing?
@jpsim Yah, I'd be happy to take a look at this.
Is it possible to set an exception somewhere in SwiftLint's config for terms we cannot control, such as mastercard
?
Most helpful comment
@jpsim Yah, I'd be happy to take a look at this.