Skip to content

Commit e32835c

Browse files
authored
Add Doxygen annotations, resolve TODOs, and minimize stale CI comments (#8)
## Pull Request ### Description Add directional Doxygen `@param` annotations to all generated and hand-written C headers, resolve remaining TODO comments across the Python tooling, and auto-minimize stale CI report comments on PRs. 1. **Doxygen `@param[in]`/`@param[out]` annotations**: Updated 7 Jinja2 templates (`sequence_get`, `sequence_has_extension`, `sequence_has_field`, `sequence_size`, `sequence_internal_off`, `sequence_internal_width`, `bitstring_internal_get_one`) and 3 hand-written headers (`J2735_internal_common.h`, `J2735_internal_inline.h`, `J2735_api.h`) to use directional parameter annotations. All 15 generated DE headers and 4 generated DF headers now emit `@param[in]`/`@param[out]` consistently. 2. **TODO resolution — `j2735.py`**: Replaced two independent `--summary`/`--types` argparse arguments with `add_mutually_exclusive_group()`, so conflicting flags produce a proper error instead of silently ignoring one; removed the associated TODO. 3. **TODO resolution — `j2735_c_generator_jinja.py`**: Removed stale `filter_c_type` TODO (6 existing doctests already cover the function); suppressed Pylance `reportUnknownMemberType` on untyped `env.filters` with an explicit `cast(dict[str, Any], ...)`. 4. **TODO resolution — `j2735_spec_parser.py`**: Replaced circular-reference TODO+`pass` with a descriptive comment and explicit `return None`; clarified 8 "Inspect if still unused" field TODOs → "Evaluate for generated C Doxygen" to reflect their actual status. 5. **TODO resolution — `j2735_spec_constraints.py`**: Replaced placeholder `TODO` docstring on `BitStringConstraint.ext_bits` with a proper description. 6. **Template fix**: Removed stale `@todo` markers from `assemble_de_bitstring.j2`; fixed non-extensible wire-format docs that incorrectly included an extension bit in the total count. 7. **CI workflows**: Added GraphQL `minimizeComment` mutation to both `ci.yml` and `python.yml` to auto-collapse stale report comments from previous commits. ### Related Issue N/A ### Additional Notes N/A ### Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Performance improvement ### Checklist - [x] My code follows the project's zero-copy coding style - [x] I have read the [CONTRIBUTING.md](../CONTRIBUTING.md) guidelines - [x] I have added/updated documentation as needed - [x] I have added tests that prove my fix/feature works - [x] I have run `make pre-push` and all checks pass - [x] I have signed my commits (DCO) using `git commit -s` --------- Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
1 parent 292c501 commit e32835c

38 files changed

Lines changed: 182 additions & 170 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,25 @@ jobs:
460460
461461
const existing = comments.data.find(c => c.body.includes(marker));
462462
463+
// Minimize stale report comments from previous commits
464+
const prefix = '<!-- j2735-ci-report-';
465+
const stale = comments.data.filter(c =>
466+
c.body.includes(prefix) && !c.body.includes(marker)
467+
);
468+
for (const old of stale) {
469+
try {
470+
await github.graphql(`
471+
mutation($id: ID!) {
472+
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
473+
minimizedComment { isMinimized }
474+
}
475+
}
476+
`, { id: old.node_id });
477+
} catch (error) {
478+
console.warn(`Failed to minimize stale comment ${old.id}:`, error);
479+
}
480+
}
481+
463482
if (existing) {
464483
await github.rest.issues.updateComment({
465484
owner: context.repo.owner,

.github/workflows/python.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,25 @@ jobs:
509509
510510
const existing = comments.data.find(c => c.body.includes(marker));
511511
512+
// Minimize stale report comments from previous commits
513+
const prefix = '<!-- j2735-python-ci-report-';
514+
const stale = comments.data.filter(c =>
515+
c.body.includes(prefix) && !c.body.includes(marker)
516+
);
517+
for (const old of stale) {
518+
try {
519+
await github.graphql(`
520+
mutation($id: ID!) {
521+
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
522+
minimizedComment { isMinimized }
523+
}
524+
}
525+
`, { id: old.node_id });
526+
} catch (error) {
527+
console.warn(`Failed to minimize stale comment ${old.id}: ${error}`);
528+
}
529+
}
530+
512531
if (existing) {
513532
await github.rest.issues.updateComment({
514533
owner: context.repo.owner,

src/J2735_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
/**
2020
* @file
2121
* @author Yogev Neumann
22-
* @brief TODO
22+
* @brief J2735 UPER parsing toolkit - public API aggregating all type definitions and access
23+
* macros.
2324
*/
2425
#ifndef J2735_API_H
2526
#define J2735_API_H

src/J2735_internal_DE_AllowedManeuvers.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
*
5454
* 12-bit read layout (left-justified from bit 0):
5555
* [F0..F11] (12 flag bits, no extension marker)
56-
*
57-
* @todo Update the Doxygen to indicate [in] and [out] parameters
5856
*/
5957
#ifndef J2735_INTERNAL_DE_ALLOWEDMANEUVERS_H
6058
#define J2735_INTERNAL_DE_ALLOWEDMANEUVERS_H
@@ -144,7 +142,8 @@
144142
* @internal
145143
* @brief Extract a single flag bit from pre-read 12-bit raw value.
146144
*
147-
* @param[in] raw12 Value previously returned by J2735_INTERNAL_RAW_READ_ALLOWED_MANEUVERS().
145+
* @param[in] raw12 Value previously returned by
146+
* J2735_INTERNAL_RAW_READ_ALLOWED_MANEUVERS().
148147
* @param[in] bit_pos ASN.1 bit position (0-11). Use J2735_INTERNAL_BIT_ALLOWED_MANEUVERS_*
149148
* constants.
150149
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_BrakeAppliedStatus.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
*
4747
* 5-bit read layout (left-justified from bit 0):
4848
* [F0..F4] (5 flag bits, no extension marker)
49-
*
50-
* @todo Update the Doxygen to indicate [in] and [out] parameters
5149
*/
5250
#ifndef J2735_INTERNAL_DE_BRAKEAPPLIEDSTATUS_H
5351
#define J2735_INTERNAL_DE_BRAKEAPPLIEDSTATUS_H
@@ -130,7 +128,8 @@
130128
* @internal
131129
* @brief Extract a single flag bit from pre-read 5-bit raw value.
132130
*
133-
* @param[in] raw5 Value previously returned by J2735_INTERNAL_RAW_READ_BRAKE_APPLIED_STATUS().
131+
* @param[in] raw5 Value previously returned by
132+
* J2735_INTERNAL_RAW_READ_BRAKE_APPLIED_STATUS().
134133
* @param[in] bit_pos ASN.1 bit position (0-4). Use J2735_INTERNAL_BIT_BRAKE_APPLIED_STATUS_*
135134
* constants.
136135
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_ExteriorLights.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
* bit16 15..7 6..0
6262
* Extended: [Ext=1][nsnnwn:7][F0..F8]
6363
* bit16 15..9 8..0
64-
*
65-
* @todo Update the Doxygen to indicate [in] and [out] parameters
6664
*/
6765
#ifndef J2735_INTERNAL_DE_EXTERIORLIGHTS_H
6866
#define J2735_INTERNAL_DE_EXTERIORLIGHTS_H
@@ -205,7 +203,8 @@ _Static_assert(J2735_INTERNAL_MAX_WIRE_BITS_EXTERIOR_LIGHTS ==
205203
* F0 at bit 8, F1 at bit 7, ..., F8 at bit 0
206204
* Formula: (raw17 >> (8 - bit_pos)) & 1
207205
*
208-
* @param[in] raw17 Value previously returned by J2735_INTERNAL_RAW_READ_EXTERIOR_LIGHTS().
206+
* @param[in] raw17 Value previously returned by
207+
* J2735_INTERNAL_RAW_READ_EXTERIOR_LIGHTS().
209208
* @param[in] bit_pos ASN.1 bit position (0-8). Use J2735_INTERNAL_BIT_EXTERIOR_LIGHTS_*
210209
* constants.
211210
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_GNSSstatus.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
*
5050
* 8-bit read layout (left-justified from bit 0):
5151
* [F0..F7] (8 flag bits, no extension marker)
52-
*
53-
* @todo Update the Doxygen to indicate [in] and [out] parameters
5452
*/
5553
#ifndef J2735_INTERNAL_DE_GNSSSTATUS_H
5654
#define J2735_INTERNAL_DE_GNSSSTATUS_H
@@ -136,7 +134,8 @@
136134
* @internal
137135
* @brief Extract a single flag bit from pre-read 8-bit raw value.
138136
*
139-
* @param[in] raw8 Value previously returned by J2735_INTERNAL_RAW_READ_GNSS_STATUS().
137+
* @param[in] raw8 Value previously returned by
138+
* J2735_INTERNAL_RAW_READ_GNSS_STATUS().
140139
* @param[in] bit_pos ASN.1 bit position (0-7). Use J2735_INTERNAL_BIT_GNSS_STATUS_*
141140
* constants.
142141
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_LaneDirection.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
*
4444
* 2-bit read layout (left-justified from bit 0):
4545
* [F0..F1] (2 flag bits, no extension marker)
46-
*
47-
* @todo Update the Doxygen to indicate [in] and [out] parameters
4846
*/
4947
#ifndef J2735_INTERNAL_DE_LANEDIRECTION_H
5048
#define J2735_INTERNAL_DE_LANEDIRECTION_H
@@ -124,7 +122,8 @@
124122
* @internal
125123
* @brief Extract a single flag bit from pre-read 2-bit raw value.
126124
*
127-
* @param[in] raw2 Value previously returned by J2735_INTERNAL_RAW_READ_LANE_DIRECTION().
125+
* @param[in] raw2 Value previously returned by
126+
* J2735_INTERNAL_RAW_READ_LANE_DIRECTION().
128127
* @param[in] bit_pos ASN.1 bit position (0-1). Use J2735_INTERNAL_BIT_LANE_DIRECTION_*
129128
* constants.
130129
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_LaneSharing.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
*
5252
* 10-bit read layout (left-justified from bit 0):
5353
* [F0..F9] (10 flag bits, no extension marker)
54-
*
55-
* @todo Update the Doxygen to indicate [in] and [out] parameters
5654
*/
5755
#ifndef J2735_INTERNAL_DE_LANESHARING_H
5856
#define J2735_INTERNAL_DE_LANESHARING_H
@@ -140,7 +138,8 @@
140138
* @internal
141139
* @brief Extract a single flag bit from pre-read 10-bit raw value.
142140
*
143-
* @param[in] raw10 Value previously returned by J2735_INTERNAL_RAW_READ_LANE_SHARING().
141+
* @param[in] raw10 Value previously returned by
142+
* J2735_INTERNAL_RAW_READ_LANE_SHARING().
144143
* @param[in] bit_pos ASN.1 bit position (0-9). Use J2735_INTERNAL_BIT_LANE_SHARING_*
145144
* constants.
146145
* @return 0 or 1 as uint8_t.

src/J2735_internal_DE_PersonalAssistive.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
* bit13 12..7 6..0
5959
* Extended: [Ext=1][nsnnwn:7][F0..F5]
6060
* bit13 12..6 5..0
61-
*
62-
* @todo Update the Doxygen to indicate [in] and [out] parameters
6361
*/
6462
#ifndef J2735_INTERNAL_DE_PERSONALASSISTIVE_H
6563
#define J2735_INTERNAL_DE_PERSONALASSISTIVE_H
@@ -199,7 +197,8 @@ _Static_assert(J2735_INTERNAL_MAX_WIRE_BITS_PERSONAL_ASSISTIVE ==
199197
* F0 at bit 5, F1 at bit 4, ..., F5 at bit 0
200198
* Formula: (raw14 >> (5 - bit_pos)) & 1
201199
*
202-
* @param[in] raw14 Value previously returned by J2735_INTERNAL_RAW_READ_PERSONAL_ASSISTIVE().
200+
* @param[in] raw14 Value previously returned by
201+
* J2735_INTERNAL_RAW_READ_PERSONAL_ASSISTIVE().
203202
* @param[in] bit_pos ASN.1 bit position (0-5). Use J2735_INTERNAL_BIT_PERSONAL_ASSISTIVE_*
204203
* constants.
205204
* @return 0 or 1 as uint8_t.

0 commit comments

Comments
 (0)