SwiftLint
                                
                                 SwiftLint copied to clipboard
                                
                                    SwiftLint copied to clipboard
                            
                            
                            
                        inclusive_language false positive: mastery contains the term master
New Issue Checklist
- [x] SwiftLint: 0.49.0
- [x] I searched for existing GitHub issues
Describe the bug
A false positive case for the master word when we actually use mastery:
enum Category {
    case productivity
    case mastery
    // ...
}
It is also triggered for all words containing master, like bushmaster or headmaster. The last two a pretty rare to be used inside of a codebase, however, the mastery is something that can be used widely to describe some category in the app or skill in the game.
Error example
error: Inclusive Language Violation: Declaration mastery contains the term "master" which is not considered inclusive. (inclusive_language)
The inclusive_language rule provides the configuration option override_allowed_terms that exists exactly to exclude these kinds of false-positives. Adding
inclusive_language:
  override_allowed_terms: ["mastery"]
to your .swiftlint.yml file should do the trick.
@daltonclaybrook I thought the rule had been updated to avoid this kind of false positive?
@jpsim Yeah, I thought so too. I'll take a look.
@jpsim Okay, this is how we're handling false-positives. We just have a default set of allowed terms. We could add "mastery" to this list, or we could make this rule a little smarter.
The configuration is expressive enough to overcome the issue. In fact, every false-positive can be fixed by configuration easily. I don't see an urgent need for improvement here.