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

Conversation

michael-jabbour-sonarsource
Copy link
Contributor

@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
Contributor

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
@michael-jabbour-sonarsource michael-jabbour-sonarsource force-pushed the mj/workaround_for_cfamily_headers branch from aec5103 to d58d1bc Compare December 4, 2024 15:07
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource deleted the branch feature/cfamily-migration December 9, 2024 12:49
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
@michael-jabbour-sonarsource michael-jabbour-sonarsource force-pushed the mj/workaround_for_cfamily_headers branch from d58d1bc to 471a48f Compare December 9, 2024 13:33
Copy link

sonarqubecloud bot commented Dec 9, 2024

@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource merged commit 37eb38b into feature/cfamily-migration Dec 10, 2024
4 checks passed
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource deleted the mj/workaround_for_cfamily_headers branch December 10, 2024 11:23
georgii-borovinskikh-sonarsource pushed a commit that referenced this pull request Dec 24, 2024
[SLVS-1668](https://sonarsource.atlassian.net/browse/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`.

[SLVS-1668]:
https://sonarsource.atlassian.net/browse/SLVS-1668?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
georgii-borovinskikh-sonarsource pushed a commit that referenced this pull request Dec 24, 2024
[SLVS-1668](https://sonarsource.atlassian.net/browse/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`.

[SLVS-1668]:
https://sonarsource.atlassian.net/browse/SLVS-1668?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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.

3 participants