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

Support running C++ MISRA rules #4604

Closed
8 tasks done
georgii-borovinskikh-sonarsource opened this issue Jul 26, 2023 · 0 comments
Closed
8 tasks done

Support running C++ MISRA rules #4604

georgii-borovinskikh-sonarsource opened this issue Jul 26, 2023 · 0 comments

Comments

@georgii-borovinskikh-sonarsource
Copy link
Contributor

georgii-borovinskikh-sonarsource commented Jul 26, 2023

Description

Version v6.47 of the CFamily adds MISRA rules for C and C++ (see #4571). However, the metadata data for these rules is stored in separate files from the "normal" rules, so the MISRA rules are not recognised by SonarLint for Visual Studio and so are not executed.

Note: all of the MISRA rules are disabled by default.

In standalone mode end users will be able toexecute them by explicitly enabling a rule in the settings.json file.
The rules will be executed in Connected Mode by activating them in the project's Quality Profile (or by setting the Quality Profile to the built-in Mission critical Quality Profile).

Notes

The MISRA23 rules are not added to the main list and quality profile in the plugin jar. They are placed in a separate folder with a separate rule list and QP (which includes normal rules as well).

TODO

  • update the CFamily preprocessor to extract the MISRA rule list and rule json files
  • amend the rule provider to return the MISRA rule ids

TODO - testing - standalone mode

  • check rules can be enabled and executed
  • check rules can be disabled
  • check rule help is shown in the IDE

TODO - testing - Connected Mode

  • check rules can be enabled in QPs
  • check rules cannot be disabled in the IDE
  • check rule help is shown in the IDE
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource changed the title Some CFamily rules are not loaded Some CFamily rules are not loaded fully Jul 27, 2023
@duncanp-sonar duncanp-sonar changed the title Some CFamily rules are not loaded fully MISRA rules are not supported Jul 27, 2023
duncanp-sonar added a commit that referenced this issue Jul 27, 2023
duncanp-sonar added a commit that referenced this issue Jul 28, 2023
NB does not include enable MISRA rules - see #4604

Fixes #4571
duncanp-sonar added a commit that referenced this issue Jul 28, 2023
NB does not include enable MISRA rules - see #4604

Fixes #4571
duncanp-sonar added a commit that referenced this issue Jul 28, 2023
@duncanp-sonar duncanp-sonar added this to In progress in Run Hotspots in local Jul 28, 2023
@duncanp-sonar duncanp-sonar self-assigned this Jul 28, 2023
@duncanp-sonar duncanp-sonar removed this from In progress in Run Hotspots in local Jul 28, 2023
@duncanp-sonar duncanp-sonar moved this from To do to In progress in Analyzer updates (July 2023) Jul 28, 2023
@duncanp-sonar duncanp-sonar moved this from In progress to Review in progress in Analyzer updates (July 2023) Jul 28, 2023
@duncanp-sonar duncanp-sonar changed the title MISRA rules are not supported Support running C++ MISRA rules Jul 28, 2023
duncanp-sonar added a commit that referenced this issue Jul 28, 2023
…es (#4617)

* Update CFamily Analyzer to 6.47.0.62356
* Support processing of MISRA rules

Fixes #4571 and #4604
Analyzer updates (July 2023) automation moved this from Review in progress to Done Jul 28, 2023
@duncanp-sonar duncanp-sonar added this to the 7.1 milestone Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants