-
Notifications
You must be signed in to change notification settings - Fork 363
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
clang: Handle old C++ standard aliases #2816
Comments
Normally, the sensors support all the rules of the current version and also those of the previous versions. With cxx 2.2.x we can think about cleaning up and removing outdated rules. For me, the decisive factor is always which version of the tool is included in larger Linux distributions. These rules should at least be supported:
|
Mapping a rule ID can lead to an issue being moved from old code to new code. See also Issue identification mechanisms to learn how new issues are calculated. In some cases the mechanism is doing a backdating. In case we are doing a mapping the correct way is to register the mapping during repository creation. Description: CxxClangTidyRuleRepository: sonar-cxx/cxx-sensors/src/main/java/org/sonar/cxx/sensors/clangtidy/CxxClangTidyRuleRepository.java Line 45 in 24f35c7
|
Asking SonarSource for details to deprecated rules: https://community.sonarsource.com/t/handling-of-deprecated-rules/131032 |
@cmorve-te I'm playing around with it to find a correct solution. |
Summary:
|
@cmorve-te: I played around with it, see description above. I tend to the following solution:
|
What do we achieve with this? It's a way of saying "we will stop supporting your old toolchain soon". But C++ developers would be happy to be able to use coroutines, modules and the latest and the greatest, if they are using an old toolchain it's because it's imposed by an external entity. Telling them "it's old" it's not going to change anything, they will just say "I know, I wish I could update it".
Do we want people updating their toolchain to get a "new" issue that's actually the same one that already existed, just with a different name? Some people will be using multiple toolchains (building for different targets), they will get the same issue duplicated, with different names. What's the problem with your original idea of just adding the addDeprecatedRuleKey rule now (deleting the standalone old one)? From what I understand:
|
i.e. https://github.com/SonarOpenCommunity/sonar-cxx/pull/2824/files seems fine to me. Isn't it? |
clangtidy.xml includes, for example, both a clang-diagnostic-c++1y-extensions rule and a clang-diagnostic-c++14-extensions rule. They are logically the same rule, though.
If somebody is scanning the output of an old version of clang, and "clang-diagnostic-c++1y-extensions" is found, it should probably be treated as a clang-diagnostic-c++14-extensions match.
AFAICT this applies to the following rules
C++14
clang-diagnostic-c++1y-extensions -> clang-diagnostic-c++14-extensions
C++17
clang-diagnostic-c++1z-compat -> clang-diagnostic-c++17-compat
clang-diagnostic-c++1z-compat-mangling -> clang-diagnostic-c++17-compat-mangling
clang-diagnostic-c++1z-extensions -> clang-diagnostic-c++17-extensions
C++20
clang-diagnostic-c++2a-compat -> clang-diagnostic-c++20-compat
clang-diagnostic-c++2a-compat-pedantic -> clang-diagnostic-c++20-compat-pedantic
clang-diagnostic-c++2a-extensions -> clang-diagnostic-c++20-extensions
C++23
clang-diagnostic-c++2b-extensions -> clang-diagnostic-c++23-extensions
clang-diagnostic-pre-c++2b-compat -> clang-diagnostic-pre-c++23-compat
clang-diagnostic-pre-c++2b-compat-pedantic -> clang-diagnostic-pre-c++23-compat-pedantic
C++26
clang-diagnostic-c++2c-compat -> clang-diagnostic-c++26-compat
clang-diagnostic-c++2c-extensions -> clang-diagnostic-c++26-extensions
clang-diagnostic-pre-c++2c-compat -> clang-diagnostic-pre-c++26-compat
clang-diagnostic-pre-c++2c-compat-pedantic -> clang-diagnostic-pre-c++26-compat-pedantic
The text was updated successfully, but these errors were encountered: