Skip to content

Declarations4 cpp misra 2023 #1100

Open
knewbury01 wants to merge 2 commits intogithub:mainfrom
knewbury01:knewbury01/cpp-misra2023-declarations4
Open

Declarations4 cpp misra 2023 #1100
knewbury01 wants to merge 2 commits intogithub:mainfrom
knewbury01:knewbury01/cpp-misra2023-declarations4

Conversation

@knewbury01
Copy link
Copy Markdown
Collaborator

@knewbury01 knewbury01 commented Apr 1, 2026

Description

please enter the description of your change here

Change request type

  • Release or process automation (GitHub workflows, internal scripts)
  • Internal documentation
  • External documentation
  • Query files (.ql, .qll, .qls or unit tests)
  • External scripts (analysis report or other code shipped as part of a release)

Rules with added or modified queries

  • No rules added
  • Queries have been added for the following rules:
    • RULE-10-1-2
  • Queries have been modified for the following rules:
    • rule number here

Release change checklist

A change note (development_handbook.md#change-notes) is required for any pull request which modifies:

  • The structure or layout of the release artifacts.
  • The evaluation performance (memory, execution time) of an existing query.
  • The results of an existing query in any circumstance.

If you are only adding new rule queries, a change note is not required.

Author: Is a change note required?

  • Yes
  • No

🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.

  • Confirmed

Reviewer: Confirm that either a change note is not required or the change note is required and has been added.

  • Confirmed

Query development review checklist

For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:

Author

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

Reviewer

  • Have all the relevant rule package description files been checked in?
  • Have you verified that the metadata properties of each new query is set appropriately?
  • Do all the unit tests contain both "COMPLIANT" and "NON_COMPLIANT" cases?
  • Are the alert messages properly formatted and consistent with the style guide?
  • Have you run the queries on OpenPilot and verified that the performance and results are acceptable?
    As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
  • Does the query have an appropriate level of in-query comments/documentation?
  • Have you considered/identified possible edge cases?
  • Does the query not reinvent features in the standard library?
  • Can the query be simplified further (not golfed!)

@knewbury01 knewbury01 self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 20:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new MISRA C++:2023 query implementation and test coverage for RULE-10-1-2 (“The volatile qualifier shall be used appropriately”), and wires it into the rule/package infrastructure.

Changes:

  • Register RULE-10-1-2 in rules.csv under the new Declarations4 package.
  • Add rule package metadata for Declarations4 and a new query implementation for RULE-10-1-2.
  • Add a dedicated unit test directory with .qlref, .expected, and test.cpp cases.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rules.csv Points RULE-10-1-2 at the new Declarations4 package and fills in the mapping field.
rule_packages/cpp/Declarations4.json Introduces package metadata for RULE-10-1-2 query.
cpp/misra/src/rules/RULE-10-1-2/VolatileQualifierNotUsedAppropriately.ql New CodeQL query implementing RULE-10-1-2.
cpp/misra/test/rules/RULE-10-1-2/test.cpp Adds COMPLIANT/NON_COMPLIANT test cases for the new query.
cpp/misra/test/rules/RULE-10-1-2/VolatileQualifierNotUsedAppropriately.qlref Hooks the test directory to the production query.
cpp/misra/test/rules/RULE-10-1-2/VolatileQualifierNotUsedAppropriately.expected Expected results matching the NON_COMPLIANT annotations.
cpp/common/src/codingstandards/cpp/exclusions/cpp/Declarations4.qll Adds autogenerated exclusions metadata wrapper for the new query.
cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll Updates query metadata wiring, but currently contains an unresolved merge conflict.

@knewbury01 knewbury01 changed the title Declarations 4 misra 2023 cpp Declarations4 cpp misra 2023 Apr 1, 2026
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