Excluding based on file extension
SonarQube Cloud can exclude files from analysis based on their 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. See Retrieving projects for more details.
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
Introduction to Adjusting analysis scope
Last updated
Was this helpful?