Conversation
…uence_code function Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
… new sub-template Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…a elements Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…ataclasses and remove dead code in bitstring template Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…m ROOT_SIZE to ROOT_SIZE_BITS Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…dd tests Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…dle new abbreviation cases; enhance tests for clarity and coverage Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…everal test files Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
…t J2735_READ_BITS call across multiple data elements Signed-off-by: Yogev Neumann <xqgex@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Refactors BIT STRING and SEQUENCE-related naming/macros across generated C headers and Python codegen tooling, while unifying/expanding tests and improving wire-format documentation rendering.
Changes:
- Renamed BIT STRING public macro
*_IS_EXTENDED→*_HAS_EXTENSIONandROOT_SIZE→ROOT_SIZE_BITS, updating templates, generated headers, and tests accordingly. - Added compile-time
_Static_assertguards ensuring BIT STRING encodings fit within a singleJ2735_READ_BITS(≤ 56 bits). - Refactored Python test utilities to centralize SEQUENCE template rendering and improved wire-format table rendering by delegating box drawing to a sub-template.
Reviewed changes
Copilot reviewed 81 out of 81 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/tests/spec/test_properties.py | Updates expectations for extensible SEQUENCE uper_bit_width semantics. |
| tools/tests/conftest.py | Adds shared generate_sequence_code() helper for SEQUENCE template-based tests. |
| tools/tests/c_generator/test_sequence_size_func.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_root_size.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_internal_width.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_internal_prefix_bits.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_internal_opt.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_internal_off.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_has_field.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_has_extension.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_sequence_get.py | Migrates tests to shared SEQUENCE code generator helper. |
| tools/tests/c_generator/test_jinja_filters.py | Updates tests for enhanced abbreviation splitting in naming filters. |
| tools/tests/c_generator/test_choice_type.py | Unifies spec-loading via SpecLoadingTestBase. |
| tools/tests/c_generator/test_bitstring_size.py | Updates BIT STRING size naming docs to ROOT_SIZE_BITS. |
| tools/tests/c_generator/test_bitstring_internal_root_size.py | Updates expectations for J2735_INTERNAL_ROOT_SIZE_BITS_* constants. |
| tools/tests/c_generator/test_bitstring_internal_raw_read.py | Updates assertions to avoid ROOT_SIZE_BITS in non-extensible RAW_READ paths. |
| tools/tests/c_generator/test_bitstring_has_extension.py | Renames template + assertions to *_HAS_EXTENSION. |
| tools/tests/c_generator/test_bitstring_common.py | Updates naming-consistency checks to *_HAS_EXTENSION. |
| tools/tests/c_generator/test_assemble_df_sequence.py | Unifies spec-loading via SpecLoadingTestBase. |
| tools/tests/c_generator/test_assemble_de_bitstring.py | Updates assertions for ROOT_SIZE_BITS usage and naming. |
| tools/templates/wire_format_table.j2 | Delegates box drawing to shared sub-template. |
| tools/templates/wire_format_draw_box.j2 | New sub-template for Unicode box-drawing rendering. |
| tools/templates/wire_format_choice_section.j2 | Delegates box drawing to shared sub-template. |
| tools/templates/bitstring/bitstring_size.j2 | Updates extensible BIT STRING size macro to ROOT_SIZE_BITS naming. |
| tools/templates/bitstring/bitstring_internal_root_size.j2 | Renames internal constant pattern to ROOT_SIZE_BITS. |
| tools/templates/bitstring/bitstring_internal_is_extension.j2 | Updates public API note to *_HAS_EXTENSION(). |
| tools/templates/bitstring/bitstring_internal_get_one.j2 | Updates docs to refer to HAS_EXTENSION precondition. |
| tools/templates/bitstring/bitstring_internal_get_all.j2 | Updates internal masking to use ROOT_SIZE_BITS constants. |
| tools/templates/bitstring/bitstring_has_extension.j2 | New/renamed public macro template for *_HAS_EXTENSION. |
| tools/templates/bitstring/bitstring_get_one.j2 | Updates preconditions/warnings to HAS_EXTENSION. |
| tools/templates/bitstring/bitstring_get.j2 | Updates note to refer to HAS_EXTENSION. |
| tools/templates/assemble_de_bitstring.j2 | Adds ≤56-bit _Static_assert and switches includes to has-extension template. |
| tools/j2735_spec_constraints.py | Changes SEQUENCE uper_bit_width behavior for extensible types + updates docs. |
| tools/j2735_c_generator_wire_format.py | Makes wire-format dataclasses kw_only=True. |
| tools/j2735_c_generator_jinja.py | Enhances filter_screaming_snake abbreviation splitting; expands docs/examples. |
| tools/j2735_c_generator_data_frame.py | Docstring wording fix (“Data Frame” vs “Data Element”). |
| tests/J2735_internal_DF_PathPrediction_test.c | Improves test header documentation (ASN.1 + wire-format summary). |
| tests/J2735_internal_DF_IntersectionReferenceID_test.c | Improves test header documentation (ASN.1 + wire-format summary). |
| tests/J2735_internal_DF_BSMcoreData_test.c | Improves test header documentation and clarifies padding rationale. |
| tests/J2735_internal_DF_ApproachOrLane_test.c | Improves test header documentation (ASN.1 + wire-format summary). |
| tests/J2735_internal_DE_VerticalAccelerationThreshold_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_VerticalAccelerationThreshold_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_VehicleEventFlags_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION. |
| tests/J2735_internal_DE_UserSizeAndBehaviour_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION. |
| tests/J2735_internal_DE_TransitStatus_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_TransitStatus_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_TrafficLightOperationStatus_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_PublicSafetyDirectingTrafficSubType_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_PublicSafetyAndRoadWorkerActivity_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_PersonalDeviceUsageState_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_PersonalAssistive_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_LaneSharing_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_LaneSharing_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_LaneDirection_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_LaneDirection_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_GNSSstatus_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_GNSSstatus_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_ExteriorLights_test.c | Renames *_IS_EXTENDED usage to *_HAS_EXTENSION + adds bit numbering notes. |
| tests/J2735_internal_DE_BrakeAppliedStatus_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_BrakeAppliedStatus_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_internal_DE_AllowedManeuvers_test.h | Renames test prototype to *_has_extension. |
| tests/J2735_internal_DE_AllowedManeuvers_test.c | Renames tests/macros to *_HAS_EXTENSION and clarifies comments. |
| tests/J2735_UPER_test.c | Clarifies misalignment padding comments. |
| src/J2735_internal_constants.h | Updates generated J2735_BW_* naming based on improved snake filter outputs. |
| src/J2735_internal_DF_BSMcoreData.h | Updates renamed J2735_BW_D_SECOND constant usage. |
| src/J2735_internal_DE_VerticalAccelerationThreshold.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_VehicleEventFlags.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_UserSizeAndBehaviour.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_TransitStatus.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_TrafficLightOperationStatus.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_PublicSafetyDirectingTrafficSubType.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_PublicSafetyAndRoadWorkerActivity.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_PersonalDeviceUsageState.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_PersonalAssistive.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_LaneSharing.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_LaneDirection.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_GNSSstatus.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_ExteriorLights.h | Renames ROOT_SIZE_BITS + HAS_EXTENSION and adds ≤56-bit _Static_assert. |
| src/J2735_internal_DE_BrakeAppliedStatus.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| src/J2735_internal_DE_AllowedManeuvers.h | Adds ≤56-bit _Static_assert and renames macro to HAS_EXTENSION. |
| .github/instructions/python_development.instructions.md | Updates pylint invocation to use repo’s pyproject config. |
Contributor
Python CI ReportCommit: Python TestsTest Output✅ All tests passed Coverage: 96%Per-file coverage (10 modules)
Details (936 statements, 41 missed)
Python Static Analysis
mypypylintflake8ruffcodespell |
Contributor
CI ReportCommit: Static Analysis
cppcheckClick to expandclang-tidyClick to expandSanitizers (ASan + UBSan)Test Output✅ No issues detected Valgrind Memory CheckTest Output✅ No memory issues detected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Systematic quality sweep focusing on BIT STRING macros, Python code generation templates, and test unification, alongside various documentation enhancements.
IS_EXTENDEDtoHAS_EXTENSIONandROOT_SIZEtoROOT_SIZE_BITSto better align with clarity standards.J2735_READ_BITScall.kw_only=Truefor wire format dataclasses.filter_screaming_snakeJinja filter to effectively handle more complex abbreviation cases, and updated related bit-width constants accordingly. Added tests covering the new abbreviated parsing logic.SpecLoadingTestBase, simplifying the test harnesses. Standardized the generation of sequence test cases by sharing a unifiedgenerate_sequence_codefunction.Related Issue
N/A
Additional Notes
N/A
Type of Change
Checklist
make pre-pushand all checks pass[Copilot is generating a summary...]
git commit -s