Swiftlint 下划线名称 swift

Kin*_*ing 4 swift swiftlint

swiftlint在我的项目中使用。项目名称是ABC xx,它适用于 swiftlint。现在我决定包含Unitest在我的应用程序中,我必须导入@testable import ABC_xx到 swift 测试文件中,这class ABC_xxTests: XCTestCase {不是我在 Swiftlinter 中遇到错误,它说Type Name Violation: Type name should only contain alphanumeric characters: 'ABC_xxTests' (type_name)我如何对这个错误进行排序

car*_*ine 8

以下 swiftlint 规则允许在 Swift 类名称中使用下划线:

type_name:
  allowed_symbols: "_"
Run Code Online (Sandbox Code Playgroud)

编辑:如果您还想对变量名称启用下划线,请使用:

identifier_name:
  allowed_symbols: "_"
Run Code Online (Sandbox Code Playgroud)