Excluding files from your project analysis based on file extension
You can define for each programming language a set of extensions (file suffixes) to be analyzed (The other extensions will be ignored.).
You can perform the setup in SonarQube UI (this requires that you have the project's Administer permission) or on the CI/CD host. A parameter set on the CI/CD host has precedence over any UI setting of the same parameter.
Defining file suffix parameters in the UI
- Retrieve your project.
- Go to Project Settings > General Settings > Languages.
- In the drop-down list, select the language you want to configure.
- Navigate to the section containing the file suffixes.
- Define the extensions to be analyzed (default values are provided).
Defining file suffix parameters on the CI/CD host
The table below lists the properties you can use to define on the CI/CD host file suffixes to be analyzed for a given language. For more information, see Analysis parameters.
Property key | Description |
---|---|
sonar.<language>.file.suffixes | Defines for a given programming language a set of extensions (file suffixes) to be analyzed (The other extensions will be ignored.). Possible values: Comma-separated list of file extensions. Note: You can see the exact property key syntax on the UI: see above. |
Related pages
- Excluding specific files from your project's code coverage analysis or duplication check
- Excluding files from your project analysis based on path-matching patterns
- Applying advanced exclusions to your project analysis
- Performing other analysis scope adjustments
- Setting the initial scope of your project
- Verifying the analysis scope of your project
- Adjusting the analysis scope at the global level
Was this page helpful?