Skip to content

Implement C Memory1 package #224

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

Merged
merged 5 commits into from
Mar 8, 2023
Merged

Implement C Memory1 package #224

merged 5 commits into from
Mar 8, 2023

Conversation

nicolaswill
Copy link
Contributor

@nicolaswill nicolaswill commented Mar 2, 2023

Description

This pull request implements the Memory1 package. RULE-9-5 is blocked at the moment and not in this PR.

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-9-2 - closes github/coding-standards-team#755
    • RULE-9-3 - closes github/coding-standards-team#756
    • RULE-9-4 - closes github/coding-standards-team#757
  • 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!)

@nicolaswill nicolaswill requested a review from knewbury01 March 2, 2023 21:53
RULE-9-5 is currently blocked due to CodeQL extractor non-support for identifying designated initializers in array aggregate literals.
@github github deleted a comment from github-actions bot Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from jsinglet Mar 2, 2023
@github github deleted a comment from github-actions bot Mar 2, 2023
Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

hey, have only reviewed RULE-9-4 (edit) 9-2! so far, so just the one tiny metadata comment, but otherwise looks good, completely agree import,

will finish my review of the other 2 rules on Mon!

Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

just a few minor comments for RULE-9-4 :)

will submit a separate review for RULE-9-3!

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status! I will report even if this PR does not contain files eligible for matrix testing.

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! gcc/c/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! clang/c/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! clang/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! gcc/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! Matrix Testing for this PR has been completed. If no reports were posted it means this PR does not contain things that need matrix testing!

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status! I will report even if this PR does not contain files eligible for matrix testing.

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! gcc/c/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! clang/c/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! gcc/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! clang/cpp/x86_64 Matrix Testing for this PR has been completed but I didn't find anything to test!

@jsinglet
Copy link
Contributor

jsinglet commented Mar 7, 2023

🤖 Beep Boop! Matrix Testing for this PR has been completed. If no reports were posted it means this PR does not contain things that need matrix testing!

Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

heyo, just one small decision on RULE-9-3, I personally am fine with it going either way, but I think I had some like this before and I forget what I was told to do 😅

other than that, will be ready to approve after that small thing! :) looks good, really great testcase coverage

@knewbury01 knewbury01 enabled auto-merge March 8, 2023 15:41
Copy link
Contributor

@knewbury01 knewbury01 left a comment

Choose a reason for hiding this comment

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

looks good! nice handling of some less than straightforward cases especially with the multidimensional arrays!

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results.

💡 If you do not hear back from me please check my status! I will report even if this PR does not contain files eligible for matrix testing.

@jsinglet
Copy link
Contributor

jsinglet commented Mar 8, 2023

🤖 Beep Boop! clang/cpp/x86_64 Matrix Testing for this PR has been completed. See below for the results!


COMPILE_PASS         : True
RULE                 : M8-5-2
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
QUERY                : UseInitBracesToMatchTypeStructure
PACKAGE              : Initialization
SUITE                : AUTOSAR
TEST_DIFFERENCE      : 

COMPILE_PASS         : True
RULE                 : M8-5-2
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
QUERY                : NestedZeroValueInitialization
PACKAGE              : Initialization
SUITE                : AUTOSAR
TEST_DIFFERENCE      : 

COMPILE_PASS         : True
RULE                 : M8-5-2
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
QUERY                : MissingExplicitInitializers
PACKAGE              : Initialization
SUITE                : AUTOSAR
TEST_DIFFERENCE      : 


@jsinglet
Copy link
Contributor

jsinglet commented Mar 8, 2023

🤖 Beep Boop! gcc/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!


SUITE                : MISRA-C-2012
QUERY                : InitializerForAggregateOrUnionNotEnclosedInBraces
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
COMPILE_PASS         : True
PACKAGE              : Memory1
TEST_DIFFERENCE      : 
RULE                 : RULE-9-2

SUITE                : MISRA-C-2012
QUERY                : PartiallyInitializedArrayWithExplicitInitializers
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
COMPILE_PASS         : True
PACKAGE              : Memory1
TEST_DIFFERENCE      : 
RULE                 : RULE-9-3

SUITE                : MISRA-C-2012
QUERY                : RepeatedInitializationOfAggregateObjectElement
COMPILE_ERROR_OUTPUT : 
TEST_PASS            : True
COMPILE_PASS         : True
PACKAGE              : Memory1
TEST_DIFFERENCE      : 
RULE                 : RULE-9-4


@jsinglet
Copy link
Contributor

jsinglet commented Mar 8, 2023

🤖 Beep Boop! clang/c/x86_64 Matrix Testing for this PR has been completed. See below for the results!


RULE                 : RULE-9-2
TEST_PASS            : True
TEST_DIFFERENCE      : 
QUERY                : InitializerForAggregateOrUnionNotEnclosedInBraces
PACKAGE              : Memory1
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
SUITE                : MISRA-C-2012

RULE                 : RULE-9-3
TEST_PASS            : True
TEST_DIFFERENCE      : 
QUERY                : PartiallyInitializedArrayWithExplicitInitializers
PACKAGE              : Memory1
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
SUITE                : MISRA-C-2012

RULE                 : RULE-9-4
TEST_PASS            : True
TEST_DIFFERENCE      : 
QUERY                : RepeatedInitializationOfAggregateObjectElement
PACKAGE              : Memory1
COMPILE_ERROR_OUTPUT : 
COMPILE_PASS         : True
SUITE                : MISRA-C-2012


@jsinglet
Copy link
Contributor

jsinglet commented Mar 8, 2023

🤖 Beep Boop! gcc/cpp/x86_64 Matrix Testing for this PR has been completed. See below for the results!


TEST_PASS            : True
QUERY                : UseInitBracesToMatchTypeStructure
RULE                 : M8-5-2
TEST_DIFFERENCE      : 
COMPILE_PASS         : True
COMPILE_ERROR_OUTPUT : 
SUITE                : AUTOSAR
PACKAGE              : Initialization

TEST_PASS            : True
QUERY                : MissingExplicitInitializers
RULE                 : M8-5-2
TEST_DIFFERENCE      : 
COMPILE_PASS         : True
COMPILE_ERROR_OUTPUT : 
SUITE                : AUTOSAR
PACKAGE              : Initialization

TEST_PASS            : True
QUERY                : NestedZeroValueInitialization
RULE                 : M8-5-2
TEST_DIFFERENCE      : 
COMPILE_PASS         : True
COMPILE_ERROR_OUTPUT : 
SUITE                : AUTOSAR
PACKAGE              : Initialization


@jsinglet
Copy link
Contributor

jsinglet commented Mar 8, 2023

🤖 Beep Boop! Matrix Testing for this PR has been completed. If no reports were posted it means this PR does not contain things that need matrix testing!

@knewbury01 knewbury01 merged commit 46f16cc into github:main Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants