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

Improve Header file lang detection by taking into consideration C++ exclusive extensions #4898

Open
AbbasNS opened this issue Sep 18, 2023 · 0 comments

Comments

@AbbasNS
Copy link
Contributor

AbbasNS commented Sep 18, 2023

To deduce a header file language (C vs C++), we currently look at:

  • vcxproj global setting in Visual Studio mode.
  • The language of an equivalent entry from the compilation database in CMake project mode.

While this method works most of the time, its accuracy can be improved when the header file extension is known to be used exclusively in C++: .hh,.hpp,.hxx,.h++,.ipp

Proposal: Take into consideration the header file language while filling HeaderFileLanguage.

Note: We should enforce that the equivalent entry in CMake project mode has a file with a C++ extension to not end up with Cpp language with C compilation options.

Related community thread: https://community.sonarsource.com/t/sonarlint-c-wrong-language-for-header-files/99263

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

No branches or pull requests

1 participant