Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new C++ rule package grouping (Declarations3) and wires two MISRA-C++-2023 rules into it, including new/shared query implementations and tests.
Changes:
- Introduces the
Declarations3rule package and updatesrules.csvto routeRULE-6-0-1andRULE-11-3-1to it. - Adds new MISRA query for
RULE-11-3-1and a MISRA wrapper query forRULE-6-0-1using a new shared implementation (FunctionDeclaredAtBlockScope). - Updates shared metadata/exclusions plumbing to include
Declarations3, and adds/rewires tests (.expected/.qlref/.testref) accordingly.
Reviewed changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rules.csv | Moves RULE-6-0-1 and RULE-11-3-1 to the Declarations3 package/category. |
| rule_packages/cpp/Declarations3.json | New package descriptor for the two MISRA rules/queries. |
| rule_packages/cpp/Declarations.json | Adds shared_implementation_short_name for M3-1-2 to use the shared implementation. |
| cpp/misra/src/rules/RULE-6-0-1/BlockScopeFunctionAmbiguous.ql | New MISRA query wrapper importing the shared block-scope function declaration implementation. |
| cpp/misra/src/rules/RULE-11-3-1/VariableDeclaredArrayType.ql | New MISRA query detecting variables declared with array type (with exclusions). |
| cpp/misra/test/rules/RULE-6-0-1/BlockScopeFunctionAmbiguous.testref | Points MISRA rule test to shared test query. |
| cpp/misra/test/rules/RULE-11-3-1/test.cpp | New test cases for array-type variable declaration detection. |
| cpp/misra/test/rules/RULE-11-3-1/VariableDeclaredArrayType.qlref | Test query reference to the new MISRA query. |
| cpp/misra/test/rules/RULE-11-3-1/VariableDeclaredArrayType.expected | Expected results for the new MISRA query test. |
| cpp/common/src/codingstandards/cpp/rules/functiondeclaredatblockscope/FunctionDeclaredAtBlockScope.qll | New shared, configurable implementation for “function declared at block scope”. |
| cpp/common/test/rules/functiondeclaredatblockscope/test.cpp | Shared tests for the new shared implementation. |
| cpp/common/test/rules/functiondeclaredatblockscope/FunctionDeclaredAtBlockScope.ql | Generated shared test harness query for the new shared implementation. |
| cpp/common/test/rules/functiondeclaredatblockscope/FunctionDeclaredAtBlockScope.expected | Expected results for the shared test harness query. |
| cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qll | Registers Declarations3 in query metadata/exclusions union. |
| cpp/common/src/codingstandards/cpp/exclusions/cpp/Declarations3.qll | New (generated) Declarations3 query metadata/exclusions package module. |
| cpp/common/test/includes/standard-library/string_view | Extends test stdlib shim to support std::literals::operator""sv. |
| cpp/autosar/src/rules/M3-1-2/FunctionsDeclaredAtBlockScope.ql | Refactors AUTOSAR query to use the new shared implementation. |
| cpp/autosar/test/rules/M3-1-2/FunctionsDeclaredAtBlockScope.testref | Points AUTOSAR rule test to shared test query. |
| cpp/autosar/test/rules/M3-1-2/FunctionsDeclaredAtBlockScope.qlref | Removes direct .qlref test in favor of .testref. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added package declarations 3
Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
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.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
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
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.
Reviewer
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.