Widgets XML Verification Script#101
Conversation
Add a defined config section. Move regexes to their own section below the config section. Add a section for types. Move "drift types" to above compute_drift() in preparation removing them. Rename OBSOLETE_WIDGETS to IGNORED_WIDGETS. Add to ignored widgets. Add to widget aliases. Add config options. Add a universal rule for __pycache__ to the .gitignore file. Rename many symbols to improve clarity. Remove unused types. Improve code comments. Clean up slop.
Update widget aliases. Remove skipped widgets from ignored widgets list. Add remotectl and remotemgr to ignored widgets list.
Add IGNORE_MISSING_PROPERTY_DOCS. Reorder configs and improve clarity.
Refactor to remove some unnecessary report types. Improve code style and layout. Rename slug_origin() to get_origin(). Clean up code.
Update report generation to derive origins from ref paths. Remove now unused origin data storage. Display origins above more sources.
…mat commit to the start.
Move sections from Other Notes to Using Doc Reports. Add a list of future improvements.
Refactor to improve readability maintainability. Rename _normalize_child_type() to normalize_child_name(). Clean up unused code.
|
@greptileai Please review of this PR. |
|
Greptile finally started. I think I pinged it at least 8 times (most deleted), and it's supposed to trigger automatically. |
|
I suppose this qualifies as testing since we're testing the docs. I'll document it in #94 once that PR is unblocked. |
Greptile SummaryThis PR adds a Python 3.11+ script (
Confidence Score: 5/5Safe to merge; the script is a standalone reporting tool with no impact on the Centrallix build or runtime. The changes add a self-contained developer tooling script and its documentation. The core parse → diff → write pipeline is logically sound, the generated filenames and .gitignore entries are consistent, and the Python version floor is correctly stated. The one finding is a dead-code comparison in parse_js that can never fire and has no effect on report correctness. No files require special attention; the dead comparison in parse_js is cosmetic and does not affect output.
|
| Filename | Overview |
|---|---|
| centrallix-doc/Widgets/doc-report/generate.py | New 1179-line Python script that parses widgets.xml, wgtr/htdrv C files, and htdrv JS files to generate doc-drift reports. Logic is generally sound after previous fix rounds; one dead-code comparison in parse_js (widget_name vs eager_widget_name) will never fire. |
| centrallix-doc/Widgets/doc-report/doc-reports-guide.md | New guide file documenting usage, output format, and design of generate.py. Filenames (report.json/report.md), Python version floor (3.11), and TOC anchors are all consistent with the script after previous fixes. |
| .gitignore | Replaces path-specific pycache entry with a global pycache/ pattern and adds ignore entries for the two generated report files; consistent with script output paths. |
| centrallix-doc/Widgets/makefile | Adds a doc-report phony target that invokes generate.py with the correct --repo-root path; straightforward addition. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[widgets.xml] -->|ElementTree + regex| B[parse_docs\ndocs, doc_types]
C[wgtr/wgtdrv_*.c] -->|c_register_re| D[parse_widgets_in_wgtr\nwidget_types, families, refs]
E[htmlgen/htdrv_*.c] -->|c_name_re\nhtrAddEvent\nhtrAddAction| F[parse_c\nc_widgets]
G[sys/js/htdrv_*.js] -->|ifcProbeAdd\nifEvent/ifAction\n.Add calls| H[parse_js\njs_widgets]
D -->|expand_any_child_coverage| B
F --> I[merge_widget_lists\nwidgets]
H --> I
B --> J[compute_report]
D --> J
I --> J
J -->|WRITE_REPORT_JSON| K[report.json]
J -->|WRITE_REPORT_MD| L[report.md]
Reviews (6): Last reviewed commit: "Fix mistake caught by Greptile." | Re-trigger Greptile
|
@greptileai Your comments should be resolved. Please re-review this code. |
Fix detection ignoring all but the first widget in htdrv_*.c files. Add a section to the docs documenting assumptions about child widgets.
Replace case-sensitive string check with more-flexible case-insensitive regex. Improve regex. Improve types.
|
@greptileai I think I've resolved all of your feedback. Please conduct a thorough re-review of the entire PR and tell me if there are any other issues. |
|
This PR is cleared for human review. |
This python3 script detects discrepancies between the
widgets.xmldocs and the widget implementations inwgtr_*.c,htr_*.c, andhtr_*.jsfiles to generate a report. The report summarizes the issues detected and provides links to make it easy for developers to quickly correct them. This branch also includes a documentation file explaining how to read the reports, how to use the script, and a high-level overview of how the script works.Note: Many of the issues detected by running this script are fixed in #100.
Example 1

Example 2

Note 1: As usual, these changes were made on a completely different dev branch, then the commits were cherry-picked to this branch. This prevents the PR being blocked behind 8+ other PRs, however, it was a difficult and technical process. If you notice any bizarre changes on this branch, please let me know.