Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement package expressions2#906

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MichaelRFairhurst wants to merge3 commits intomain
base:main
Choose a base branch
Loading
frommichaelrfairhurst/implement-package-expressions2

Conversation

MichaelRFairhurst
Copy link
Contributor

@MichaelRFairhurstMichaelRFairhurst commentedJun 3, 2025
edited
Loading

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-8-0-1
    • RULE-8-1-1
    • RULE-8-1-2
    • RULE-5-13-6
  • Queries have been modified for the following rules:
    • RULE-18-9 (no visible changes expected)
    • All rules involving suffixes

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 ofshared 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 thestyle 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 thestyle 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!)

@CopilotCopilotAI review requested due to automatic review settingsJune 3, 2025 22:06
Copy link
Contributor

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

This PR introduces the new “Expressions2” package by adding several MISRA-related CodeQL queries, refactoring expression support modules, and updating test headers to mock standard library facilities. Key changes include:

  • Addition of five new QLL queries enforcing MISRA rules RULE-8-1-2, RULE-8-1-1, RULE-8-0-1, and RULE-5-13-6.
  • Refactoring ofCpp14Literal andExpr modules to support integer suffix parsing and temporary-object flow steps.
  • Introduction of theExpressions2Package and updates to exclusions and rule metadata for the new queries.

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
cpp/misra/src/rules/RULE-8-1-2/ImplicitCapturesDisallowedInNonTransientLambda.qlNew query for explicit captures in non-transient lambdas
cpp/misra/src/rules/RULE-8-1-1/NonTransientLambdaImplicitlyCapturesThis.qlNew query preventing implicitthis captures
cpp/misra/src/rules/RULE-8-0-1/MissingSizeofOperatorParenthesis.qlNew query enforcing parentheses aroundsizeof
cpp/misra/src/rules/RULE-8-0-1/MissingPrecedenceClarifyingParenthesis.qlNew query enforcing clarifying parentheses
cpp/misra/src/rules/RULE-5-13-6/LongLongLiteralWithSingleLSuffix.qlNew query disallowing singleL suffix onlong long literals
cpp/common/src/codingstandards/cpp/graph/GraphPathStateSearch.qllAdded stateful graph search module
cpp/common/src/codingstandards/cpp/Expr.qllRefactored expression module; extractedtemporaryObjectFlowStep
cpp/common/src/codingstandards/cpp/Cpp14Literal.qllAddedIntegerLiteralSuffix class andgetSuffix()
cpp/common/src/codingstandards/cpp/Scope.qllAddedfunctionDefinedInTranslationUnit predicate
cpp/common/src/codingstandards/cpp/exclusions/cpp/Expressions2.qllNew autogenerated exclusions for Expressions2
cpp/common/src/codingstandards/cpp/exclusions/cpp/RuleMetadata.qllImportedExpressions2 in rule metadata
cpp/common/test/includes/standard-library/utility.hProvided definitions forforward overloads
cpp/common/test/includes/standard-library/functional.hUpdatedstd::function mock constructor
Comments suppressed due to low confidence (1)

cpp/common/test/includes/standard-library/utility.h:11

  • Themove function is declared but not defined. Consider providing a definition like:
template<classT>constexprremove_reference_t<T>&& move(T&& t)noexcept {returnstatic_cast<remove_reference_t<T>&&>(t);}
template <class T> constexpr remove_reference_t<T> &&move(T &&t) noexcept;

* instance, we could use this graph to find recursive functions, which requires knowing how an end
* node was reached from a start node (the state).
*
* Like `GraphPathSearch`, this module uses forward-reverse pruning, wihch is a pattern that is
Copy link
Preview

CopilotAIJun 3, 2025

Choose a reason for hiding this comment

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

Typo in comment: 'wihch' should be 'which'.

Suggested change
* Like `GraphPathSearch`,thismodule uses forward-reverse pruning,wihch is a pattern that is
* Like `GraphPathSearch`,thismodule uses forward-reverse pruning,which is a pattern that is

Copilot uses AI. Check for mistakes.

pragma[inline_late]
predicate functionDefinedInTranslationUnit(Function f, TranslationUnit tu) {
exists(FunctionDeclarationEntry fde | fde = f.getDefinition() |
fde = f.getDefinition() and
Copy link
Preview

CopilotAIJun 3, 2025

Choose a reason for hiding this comment

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

Duplicate predicate 'fde = f.getDefinition()' is redundant. Consider removing one of the identical checks to simplify the clause.

Suggested change
fde = f.getDefinition() and

Copilot uses AI. Check for mistakes.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@lcarteylcarteyAwaiting requested review from lcartey

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@MichaelRFairhurst

[8]ページ先頭

©2009-2025 Movatter.jp