Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda