Skip to content

Commit c529985

Browse files
committed
Add permitted re-categorizations
1 parent 506cd68 commit c529985

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

docs/user_manual.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
| 0.15.0 | 2023-05-24 | Mauro Baluda | Clarify AUTOSAR C++ supported versions. |
2424
| 0.16.0 | 2023-07-03 | Luke Cartey | Remove reference to LGTM, update the name of the query pack |
2525
| 0.17.0 | 2023-08-16 | Luke Cartey | Update list of supported compiler configurations. |
26-
| 0.18.0 | 2024-02-23 | Remco Vermeulen | Clarify the required use of Python version 3.9 |
26+
| 0.18.0 | 2024-02-23 | Remco Vermeulen | Clarify the required use of Python version 3.9. |
27+
| 0.19.0 | 2024-02-23 | Remco Vermeulen | Add table describing the permitted guideline re-categorizations. |
2728

2829
## Release information
2930

@@ -269,7 +270,7 @@ The CodeQL Coding Standards supports the following features from the [MISRA Comp
269270

270271
- _Deviation records_ - an entry that states a particular instance, or set of instances, of a rule should be considered permitted.
271272
- _Deviation permit_ - an entry that provides authorization to apply a deviation to a project.
272-
- _Guideline recategorization plan_ - an agreement on how the guidelines are applied. Whether a guideline may be violated, deviated from, or must always be applied.
273+
- _Guideline re-categorization plan_ - an agreement on how the guidelines are applied. Whether a guideline may be violated, deviated from, or must always be applied.
273274

274275
##### Deviation records
275276

@@ -397,16 +398,28 @@ Unlike _deviation records_ their location in the source directory does not impac
397398
This means that _deviation permits_ can be made available at build time by any means available.
398399
An example of importing _deviation permits_ is through a [Git Submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) that contains a repository of allowed _deviation permits_.
399400

400-
##### Guideline recategorization plan
401+
##### Guideline re-categorization plan
401402

402-
The current implementation supports a _guideline recategorization plan_ as described in the [MISRA Compliance:2020](https://www.misra.org.uk/app/uploads/2021/06/MISRA-Compliance-2020.pdf) section _5 The guideline re-categorization plan_.
403+
The current implementation supports a _guideline re-categorization plan_ as described in the [MISRA Compliance:2020](https://www.misra.org.uk/app/uploads/2021/06/MISRA-Compliance-2020.pdf) section _5 The guideline re-categorization plan_.
403404

404-
A recategorization plan provides a mechanism to adjust the policy associated with a guideline that determines whether it may be violated or not and if it may be violated whether a deviation is required.
405-
Each guideline recategorization **must** be specified in the `guideline-recategorizations` section of a `coding-standards.yml` file that **must** be anywhere in the source repository.
405+
A re-categorization plan provides a mechanism to adjust the policy associated with a guideline that determines whether it may be violated or not and if it may be violated whether a deviation is required.
406406

407-
A guideline recategorization specification **must** specify a `rule-id`, an identifier for the coding standards rule the recategorization applies to, and a `category`, a category that can be any of `disapplied`, `advisory`, `required`, or `mandatory`.
407+
The implementation follows the constraints on re-categorization as described in [MISRA Compliance:2020](https://www.misra.org.uk/app/uploads/2021/06/MISRA-Compliance-2020.pdf) section _5.1 Re-categorization_.
408408

409-
An example guideline recategorization section is:
409+
The following tables described the re-categorizations are permitted.
410+
411+
| Current Category | Revised Category | Revised Category | Revised Category | Revised Category |
412+
| --- | --- | --- | --- | --- |
413+
| | Mandatory | Required | Advisory | Disapplied |
414+
| Mandatory | Permitted | | | |
415+
| Required | Permitted | Permitted | | |
416+
| Advisory | Permitted | Permitted | Permitted | Permitted |
417+
418+
Each guideline re-categorization **must** be specified in the `guideline-recategorizations` section of a `coding-standards.yml` file that **must** be anywhere in the source repository.
419+
420+
A guideline re-categorization specification **must** specify a `rule-id`, an identifier for the coding standards rule the re-categorization applies to, and a `category`, a category that can be any of `disapplied`, `advisory`, `required`, or `mandatory`.
421+
422+
An example guideline re-categorization section is:
410423

411424
```yaml
412425
guideline-recategorizations:
@@ -418,7 +431,7 @@ guideline-recategorizations:
418431
category: "mandatory"
419432
```
420433

421-
Application of the guideline recategorization plan to the analysis results requires an additional post-processing step.
434+
Application of the guideline re-categorization plan to the analysis results requires an additional post-processing step.
422435
The post-processing step is implemented by the Python script `path/to/codeql-coding-standards/scripts/guideline_recategorization/recategorize.py`.
423436
The script will update the `external/<standard>/obligation/<category>` tag for each query implementing a recategorized guideline such that `<category>` is equal to the new category and
424437
add the tag `external/<standard>/original-obligation/<category` to each query implementing a recategorized guideline such that `<category>` reflects the orignal category.

0 commit comments

Comments
 (0)