Skip to content

Commit 17d73e4

Browse files
authored
Merge pull request #544 from rvermeulen/rvermeulen/fixes-for-recertification
Improve documentation for re-certification.
2 parents 3b08104 + e98b3a2 commit 17d73e4

File tree

2 files changed

+119
-92
lines changed

2 files changed

+119
-92
lines changed

docs/development_handbook.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@
3838
| 0.29.0 | 2023-10-11 | Remco Vermeulen | Update release process. |
3939
| 0.29.1 | 2023-10-11 | Remco Vermeulen | Address Markdown linter problems. |
4040
| 0.30.0 | 2023-11-14 | Remco Vermeulen | Clarify release steps in case of a hotfix release. |
41+
| 0.31.0 | 2024-02-23 | Remco Vermeulen | Clarify the required use of Python version 3.9 |
4142

4243
## Scope of work
4344

4445
A *coding standard* is a set of rules or guidelines which restrict or prohibit the use of certain dangerous or confusing coding patterns or language features. This repository contains CodeQL queries (and supporting processes) which implement a number of different coding standards. The currently supported standards are:
4546

4647
| Standard | Version | Total rules | Total supportable rules | Status | Notes |
4748
| -------------------------------------------------------------------------------------------------------------------- | ------- | ----------- | ----------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
48-
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf) | R22-11, R21-11, R20-11, R19-11, R19-03 | 397 | 375 | Implemented |
49+
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf) | R22-11, R21-11, R20-11, R19-11, R19-03 | 397 | 375 | Implemented | |
4950
| [CERT-C++](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-cpp-coding-standard-2016-v01.pdf) | 2016 | 83 | 83 | Implemented | AUTOSAR includes a sub-set of rules take from MISRA C++ 2008, which can be purchased for a small fee from [the MISRA website](https://misra.org.uk/shop). |
5051
| [CERT-C](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-c-coding-standard-2016-v01.pdf) | 2016 | 120 | 99 | In development | The implementation excludes rules not part of 2016, but that are added to the [CERT-C wiki](https://wiki.sei.cmu.edu/confluence/display/c/) |
5152
| [MISRA C](https://www.misra.org.uk/product/misra-c2012-third-edition-first-revision/ ) | 2012 | 172 | 172 | In development | This includes the [MISRA C:2012 Amendment 2](https://www.misra.org.uk/app/uploads/2021/06/MISRA-C-2012-AMD2.pdf) |
@@ -163,6 +164,7 @@ These files will be ready for query implementation.
163164

164165
#### Step 0: Prepare the Python environment
165166

167+
The tooling standardizes on Python 3.9 and requires the use of version 3.9 to run all tooling.
166168
The `scripts` directory contains the pip package specification file `requirements.txt` that contains the dependencies our generation scripts rely upon.
167169

168170
The dependencies can be installed as follows:
@@ -171,12 +173,12 @@ The dependencies can be installed as follows:
171173
pip3.9 install -r scripts/requirements.txt
172174
```
173175

174-
It is advisable to use a Python virtual environment which needs to be created and activated before installing the dependencies. This can be done as follows:
176+
It is advisable to use a Python 3.9 virtual environment which needs to be created and activated before installing the dependencies. This can be done as follows:
175177

176178
```bash
177179
python3.9 -mvenv scripts/.venv
178180
. scripts/.venv/bin/activate
179-
pip install -r scripts/requirements.txt
181+
pip3.9 install -r scripts/requirements.txt
180182
```
181183

182184
#### Step 1: Generate rule package description file
@@ -265,7 +267,7 @@ The `generate_package_description.py` script provides a "best-effort" approach t
265267
- `performance` - if the query identifies an issue which has a negative impact on the performance of the code.
266268
- `concurrency` - if the query identifies a concurrency issue.
267269
- Validate the rule package description file using the `validate-rule-package.py` script that validates the rule package descriptions against the schema `rule-package.schema.json` located in the `schemas` directory.
268-
- `python3 scripts/validate-rule-package.py <rule_package_name>`
270+
- `python3.9 scripts/validate-rule-package.py <rule_package_name>`
269271

270272
#### Step 3
271273

@@ -350,7 +352,7 @@ All public predicates, classes, modules and files should be documented with QLDo
350352

351353
### Installing QL dependencies
352354

353-
All of our query and library packs depend on the standard CodeQL library for C++, `codeql/cpp-all`. This dependency is specified in the `qlpack.yml` file for each of our packs. Before compiling, running, or testing any of our queries or libraries, you must download the proper dependencies by running `python3 scripts/install-packs.py`. This will download the appropriate version of the standard library from the public package registry, installing it in a cache in your `~/.codeql` directory. When compiling queries or running tests, the QL compiler will pick up the appropriate dependencies from this cache without any need to specify an additional library search path on the command line.
355+
All of our query and library packs depend on the standard CodeQL library for C++, `codeql/cpp-all`. This dependency is specified in the `qlpack.yml` file for each of our packs. Before compiling, running, or testing any of our queries or libraries, you must download the proper dependencies by running `python3.9 scripts/install-packs.py`. This will download the appropriate version of the standard library from the public package registry, installing it in a cache in your `~/.codeql` directory. When compiling queries or running tests, the QL compiler will pick up the appropriate dependencies from this cache without any need to specify an additional library search path on the command line.
354356

355357
Because the downloaded packs are cached, it is only necessary to run `install-packs.py` once each time we upgrade to a new standard library version. It does not hurt to run it more often; if all necessary packs are already in the download cache, then it will complete quickly without trying to download anything.
356358

0 commit comments

Comments
 (0)