Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonar.cxx.preprocessor.exclusions #2279

Open
guwirth opened this issue Nov 15, 2021 · 3 comments
Open

sonar.cxx.preprocessor.exclusions #2279

guwirth opened this issue Nov 15, 2021 · 3 comments

Comments

@guwirth
Copy link
Collaborator

guwirth commented Nov 15, 2021

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=...
@guwirth
Copy link
Collaborator Author

guwirth commented Nov 15, 2021

Maybe sonar.cxx.preprocessor.exclusions is to long, better sonar.cxx.pp.exclusions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant