Ignoring test directory

Our stack is type script and sonarcloud is including the test directory in our scans. I know you can ignore these via the web UI. Wondering if there is a way to do this using a config file within the code repository?

Hi @jamie3 ,

Welcome to SonarSource community! :sonarsource:

See Narrowing the Focus:

  • Source File Exclusions ( sonar.exclusions ) - to exclude source code files
  • Test File Exclusions ( sonar.test.exclusions ) - to exclude test files

Do note the following:

Note that only parameters set through the UI are stored in the database. For example, if you override the sonar.exclusions parameter via command line for a specific project, it will not be stored in the database.

See Analysis Parameters for more info.

Joe