-
Notifications
You must be signed in to change notification settings - Fork 67
Guideline recategorization #68
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
Guideline recategorization #68
Conversation
6b10b82
to
ba35ca1
Compare
8e4acc3
to
423fd38
Compare
a86c1cc
to
3beccc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: @rvermeulen @mbaluda and I reviewed this PR together. Here are a few additional notes. Great work! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the walkthrough, looks good to me!
The category information enables evaluation time computation of the effective category of a rule. The effective category is determined by the rule's category and a possible recategorization through a Guideline Recategorization Plan. The effective category will be used to determine how to handle a deviation applied to a query implementing the rule.
This commit adds: - A new section `guideline-recategorizations` to the configuration specification for `coding-standards.yml`. - Two tests to list all the indexed guideline recategorizations and all the invalid guideline recategorizations. This commit does not include the application of the effective category.
With the additional support of a Guideline Recategorization Plan and possible other further configuration options we are moving the script into the generic configuration folder instead of the deviations folder.
The format depends on the length of the package name so we format the generated file with the CLI instead of mirror the formating behavior in the template.
This allows us to reduce the number of CodeQL CLI invocations for performance improvements.
Each file generation for a package will update the shared meta data value for the language the package belongs to. Running generation in parallel will result in a race condition which may result in inconsistent meta data files.
In this commit we expand the meta data `Query` class to provide an effective category that is determined by combining a query's category and a possible active Guideline Recategorization Plan. The exclusion process now validates for a query with an associated deviation record whether the effective category allows a deviation. If this is not allowed, then the deviation record is not applied. Any deviation record applied to a query with an effective category not permitting deviation is considered invalid and will be listed in the analysis report.
This is used for debugging and testing purposes and cannot be used in our standard queries due to the required negation and the possible infinite possible values for reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Remco!
Co-authored-by: Robert C. Seacord <rcseacord@gmail.com>
Remove the note discussing the granularity options of applying a recategorization.
Description
This PR adds support for a Guideline Recategorization Plan as described in chapter 5 The guideline re-categorization plan of the MISRA Compliance:2020 and documented in this design
This includes:
guideline-recategorizations
section to thecoding-standards.yml
.effective category
based on a rule's category and a guideline recategorization according to the rules in chapter 5 of the standard MISRA Compliance:2020.disapplied
rules.effective category
in the resulting Sarif file.Change request type
.ql
,.qll
,.qls
or 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 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.