Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
Swiftlint underscore name swift

I use swiftlint in my project. The project name is ABC xx and it works fine with swiftlint. Now I decided to include Unitest in my application and I have to import @testable import ABC_xx into the swift test file which is class ABC_xxTests: XCTestCase { not I get an error with Swiftlinter which says Type Name Violation: Type name should only contain alphanumeric characters: 'ABC_xxTests' (type_name) how do I sort this error

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

The following swiftlint rule enable the use of underscore in your Swift class names:

type_name:
  allowed_symbols: "_"

EDIT: If you want to enable the use of underscore also for variable names use:

identifier_name:
  allowed_symbols: "_"
over 4 years ago · Santiago Trujillo Denunciar

0

In addition to @carmine's answer, keep the below two things in mind while adding attributes to any rule in .swiftlint.yml:

  • it should be listed in a new line
  • and should be preceded with a white space.

In my case I overlooked the white space before allowed_symbols. So the linting was not working. When I added white space, it was successful.

over 4 years ago · Santiago Trujillo Denunciar

0

You can disable rule for specified folder, in your case its an ABC_xxTests folder. Inside .swiftlint.yml configuration file you can use 'excluded' property. If you haven't yet create swiftlint configuration file, you can create one with name .swiftlint.yml and place it in your project root folder.

Add this lines:

excluded:
    - ABC_xxTests
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda