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

SLVS-1668 Include header file language in the VCX command #5861

Open
wants to merge 4 commits into
base: feature/cfamily-migration
Choose a base branch
from

Conversation

michael-jabbour-sonarsource
Copy link

@michael-jabbour-sonarsource michael-jabbour-sonarsource commented Nov 29, 2024

SLVS-1668

Part of SLVS-1637

See the linked ticket for details about the problems we identified. This PR introduces the following changes:

  • To communicate the header file language, I am adding the relevant switches to the generated command in the header case as well. This helps analyze C headers as such when they are located inside C VCX projects.
  • Since HeaderFileLanguage is no longer needed, I am removing it from FileConfig.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title [WIP] Workaround for cfamily headers SLVS-1668 [WIP] Workaround for cfamily headers Nov 29, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 [WIP] Workaround for cfamily headers [WIP] SLVS-1668 Workaround for cfamily headers Nov 29, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title [WIP] SLVS-1668 Workaround for cfamily headers [WIP] SLVS-1668 Workaround for CFamily headers Nov 29, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource force-pushed the mj/workaround_for_cfamily_headers branch 5 times, most recently from 3a5f1f7 to 0594303 Compare November 29, 2024 13:36
@michael-jabbour-sonarsource michael-jabbour-sonarsource force-pushed the mj/workaround_for_cfamily_headers branch 4 times, most recently from 02beb4c to 8995923 Compare November 29, 2024 16:14
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title [WIP] SLVS-1668 Workaround for CFamily headers SLVS-1668 Workaround for CFamily headers Nov 29, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Workaround for CFamily headers SLVS-1668 Workaround for CFamily header language Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Workaround for CFamily header language SLVS-1668 Communicate header file language in the VCX generated compilation database Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Communicate header file language in the VCX generated compilation database SLVS-1668 Include header file language in the VCX generated compilation database Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Include header file language in the VCX generated compilation database SLVS-1668 Include header file language in the VCX generated compdb Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Include header file language in the VCX generated compdb SLVS-1668 Include header language in the VCX generated compdb Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Include header language in the VCX generated compdb SLVS-1668 Include header file language in the VCX generated command Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource changed the title SLVS-1668 Include header file language in the VCX generated command SLVS-1668 Include header file language in the VCX command Dec 2, 2024
@michael-jabbour-sonarsource michael-jabbour-sonarsource marked this pull request as ready for review December 2, 2024 10:36
Copy link

Choose a reason for hiding this comment

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

🎉

Base automatically changed from gb/vcx-migration to feature/cfamily-migration December 4, 2024 13:44
This helps analyze headers in C projects as C code. This is needed now
that we no longer pass HeaderFileLanguage separately to the analyzer.
Normally, the CFamily analyzer deduces that the file being analyzed is a
header when there is no exact match for the file name in the given
compilation database.

This is a temporary workaround to communicate with the analyzer that
the current file is a header file. This helps the analyzer avoid
reporting some FPs.

See https://sonarsource.atlassian.net/browse/CPP-2743
Copy link

sonarcloud bot commented Dec 4, 2024

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

Successfully merging this pull request may close these issues.

2 participants