Inclusive Language

Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status.

  • Identifier: inclusive_language
  • Enabled by default: Yes
  • Supports autocorrection: No
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    severity warning

Non Triggering Examples

let foo = "abc"
enum AllowList {
    case foo, bar
func updateAllowList(add: String) {}
enum WalletItemType {
    case visa
    case mastercard
func chargeMasterCard(_ card: Card) {}

Triggering Examples

let slave = "abc"
enum BlackList {
    case foo, bar
func updateWhiteList(add: String) {}
enum ListType {
    case whitelist
    case blacklist
init(master: String, slave: String) {}
final class FooBar {
    func register<Master, Slave>(one: Master, two: Slave) {}