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 Administration > General Settings > Languages.
- In the drop-down list, select the language you want to configure.
- In the General > File suffixes parameter, 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 | 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 Defining file suffix parameters in the UI above. |
Related pages
- Setting the initial scope of your project
- Excluding specific files from your project's code coverage analysis or duplication check
- Excluding files from your project analysis based on path-matching patterns
- Excluding files from your project analysis based on file extension
- Applying advanced exclusions to your project analysis
- Performing other analysis scope adjustments
- Verifying the analysis scope of your project
- Adjusting the analysis scope at the organization level
Was this page helpful?