Skip to content

sonar.cxx.preprocessor.exclusions #2279

@guwirth

Description

@guwirth

The cxx plugin is using an preprocessor to handle the #include files. The preprocessor is searching in the sonar.cxx.includeDirectories paths for include files.

Up to now there is no possibility to exclude #includes. This could sometimes help to speed-up the analysis. Idea is to introduce a configuration setting similar to sonar.exclusions for include files only:

  • completely ignore some header files or directories in the preprocessor
  • comma separated list of items
  • directories, filenames, file extensions with/without wildcards
  • using ANT patterns

configuration key:

sonar.cxx.preprocessor.exclusions=...
  • Hint: Especially with sonar.cxx.msbuild.reportPaths and sonar.cxx.jsonCompilationDatabase, were sonar.cxx.includeDirectories is automatically generated, this could help.

Patterns

Paths are relative to the project base directory. The following wildcards can be used:

  • * - Match zero or more characters
  • ** - Match zero or more directories
  • ? - Match a single character

Other related configuration options

File extensions should be used for the cxx language are defined with:

sonar.cxx.file.suffixes=...

The source file root, additional inclusions and exclusions are defined with below settings (these are the files later on be visible in the UI):

sonar.sources=...
sonar.inclusions=...
sonar.exclusions=...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions