| # | ||
| # If none of those resolve to exactly one file, we abort with a clear message. | ||
| PDF_ENV_VARS = { | ||
| "MISRA-C-2023": "MISRA_C_PDF", |
There was a problem hiding this comment.
So just a clarification here. We should not differentiate C-2023 and C-2012 at all.
Every rule we have is both a part of MISRA C 2012, and a part of MISRA C 2023, there isn't an actual distinction. MISRA C 2012 with all amendments included = MISRA C 2023
Sorry, something went wrong.
Introduces scripts/generate_rules/misra_help/, a two-stage pipeline for (mostly) idempotent generation of per-query .md help files. It uses MISRA rule text as input and creates (or updates) documentation for codeql-coding-standards queries in C and C++.
Initial supported standards:
Stage 1 — deterministic, docling-based extraction and rendering, with a JSON sidecar for downstream consumption.
Stage 2 — a headless Python driver for the Copilot SDK that rewrites each help file from the JSON sidecar against a fixed Markdown schema, normalized to American English.
See scripts/generate_rules/misra_help/README.md for usage, architecture, and operational notes.
Description
Adds a new internal tooling package under scripts/generate_rules/misra_help/ that automates generation of per-query Markdown help files for MISRA C/C++ queries. No query files, query metadata, rule packages, shared libraries, tests, .expected files, or release artifacts are modified by this PR — it is purely additive tooling (7 new files, ~2.1k lines, all under scripts/generate_rules/misra_help/).
The pipeline is split so that the deterministic extraction stage can be re-run cheaply and audited independently of the LLM-driven rewrite stage. The JSON sidecar is the contract between the two stages, which keeps Stage 2 reproducible against a pinned input.
Change request type
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 format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
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:
N/A for this PR — no queries are added or modified. This section is left as-is for the reviewer to confirm.
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.