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

Clang-Tidy: handle clang warnings in the report file (-W) #2803

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

cmorve-te
Copy link
Contributor

@cmorve-te cmorve-te commented Nov 7, 2024

Extend the existing Clang-Tidy sensor to also understand clang compiler issues ([-W...]) in the LOG files and map them to clang-tidy rules ([clang-diagnostic-...]). Clang compiler issues would be visualized in the SQ UI as Clang-Tidy issues (as per #2325 (comment)).

Sample:

  • clang [-Wunneeded-internal-declaration]
  • clang-tidy: [clang-diagnostic-unneeded-internal-declaration]
  • [-W...] => [clang-diagnostic-...]

close #2325


This change is Reviewable

@guwirth guwirth added this to the 2.2.0 milestone Nov 7, 2024
@guwirth guwirth assigned guwirth and cmorve-te and unassigned guwirth Nov 7, 2024
@guwirth guwirth self-requested a review November 7, 2024 12:39
@guwirth
Copy link
Collaborator

guwirth commented Nov 7, 2024

@cmorve-te thanks! I run first CI before I' looking into it ...

@guwirth
Copy link
Collaborator

guwirth commented Nov 7, 2024

@cmorve-te checks of CI are green, will do a code review next.

I would like this in 2.1 too ...

Why do you wanna have it in version 2.1? The version 2.2 is also supporting SQ 9.9 LTS and SQ 10 ...

@cmorve-te
Copy link
Contributor Author

Why do you wanna have it in version 2.1? The version 2.2 is also supporting SQ 9.9 LTS and SQ 10 ...

Looking at https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Compatibility-Matrix I though 2.2 would not support 9.9. If it does, ignore it, I don't care about 2.1.

@guwirth
Copy link
Collaborator

guwirth commented Nov 7, 2024

I though 2.2 would not support 9.9. If it does, ignore it, I don't care about 2.1.

@cmorve-te In the last releases we were always supporting the current and last LTS, but this depends on the API compatibility. Currently we test the 2.2 in our CI with SQ 9.9 LTS and the latest 10.x (and currently it's working). Hope SonarSource will not do any breaking changes.

@guwirth
Copy link
Collaborator

guwirth commented Nov 7, 2024

I updated the compatibility matrix and beta release notes.

@guwirth guwirth changed the title clangtidy: Handle clang warnings Clang-Tidy: handle clang warnings in the reprot file (-W) Nov 8, 2024
@guwirth guwirth changed the title Clang-Tidy: handle clang warnings in the reprot file (-W) Clang-Tidy: handle clang warnings in the report file (-W) Nov 8, 2024
Copy link
Collaborator

@guwirth guwirth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmorve-te thanks for providing this, I will merge it. Think the Clang-Tidy parser needs some general refactoring I will do afterwards.

@guwirth guwirth merged commit 174b87b into SonarOpenCommunity:master Nov 8, 2024
12 checks passed
@guwirth
Copy link
Collaborator

guwirth commented Nov 9, 2024

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

Successfully merging this pull request may close these issues.

Clang compiler warnings support (like GCC and MSVC)
2 participants