Skip to content

Converting param type to string now in shared file#223

Merged
James Ball (james-ball-qualcomm) merged 1 commit into
mainfrom
html_type_fmt
Mar 19, 2026
Merged

Converting param type to string now in shared file#223
James Ball (james-ball-qualcomm) merged 1 commit into
mainfrom
html_type_fmt

Conversation

@james-ball-qualcomm

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: James Ball <jameball@qti.qualcomm.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes “parameter/CSR type → display string” rendering into tools/shared_utils.py and updates both the HTML params generator and the AsciiDoc appendix generator to use the shared implementation, with corresponding unit tests and golden-file updates.

Changes:

  • Add infer_param_type_string() to tools/shared_utils.py to format scalar/range/array parameter types for table output.
  • Replace duplicated type-formatting logic in tools/create_params.py (HTML tables) and tools/create_param_appendix.py (AsciiDoc output) with the shared helper.
  • Add unit tests for the new helper and update expected AsciiDoc fixtures to match the new formatting (e.g., range ... and N-bit signed/unsigned integer).

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/shared_utils.py Adds shared infer_param_type_string() formatter.
tools/create_params.py Switches HTML table type rendering to the shared formatter.
tools/create_param_appendix.py Switches AsciiDoc appendix type rendering to the shared formatter.
tests/shared_utils/test_shared_utils.py Adds unit coverage for success + fatal paths of the new formatter.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch2/ASIDLEN2.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch2/ASIDLEN1.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT_1TO100.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT6.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/UINT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/INT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/INT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_UINT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_UINT5.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_NEG10TO20.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ARRAY_OF_INT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-reordered/test-ch1/ALL_BASES.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch2/ASIDLEN2.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch2/ASIDLEN1.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT_1TO100.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT6.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/UINT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/INT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/INT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_UINT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_UINT5.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_NEG10TO20.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ARRAY_OF_INT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-table-variants/test-param-table-full-default/test-ch1/ALL_BASES.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch2/ASIDLEN2.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch2/ASIDLEN1.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT_1TO100.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT6.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/UINT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/INT_MXLEN.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/INT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_UINT64.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_UINT5.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_NEG10TO20.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ARRAY_OF_INT32.adoc Updates expected type string formatting.
tests/params/expected/test-param-appendix-adoc-includes/test-ch1/ALL_BASES.adoc Updates expected type string formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/shared_utils.py
Comment thread tools/shared_utils.py
Comment thread tools/shared_utils.py

Copilot AI commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

James Ball (@james-ball-qualcomm) I've opened a new pull request, #224, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

James Ball (@james-ball-qualcomm) I've opened a new pull request, #225, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

James Ball (@james-ball-qualcomm) I've opened a new pull request, #226, to work on those changes. Once the pull request is ready, I'll request review from you.

@james-ball-qualcomm James Ball (james-ball-qualcomm) merged commit ee0bcbb into main Mar 19, 2026
6 checks passed
@james-ball-qualcomm James Ball (james-ball-qualcomm) deleted the html_type_fmt branch March 19, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants