project-chip / alchemy

Alchemy is a command line tool for modifying and transforming Matter spec documents.
Apache License 2.0
4 stars 2 forks source link

Add TypeDef support, minor tweaks to XML output (to match XSD) #5

Closed gmarcosb closed 3 weeks ago

gmarcosb commented 1 month ago

Primary change is adding of TypeDef support

See for example VideoStreamId @ https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/a3ef8252366959537d75d4e32060d89ca18756f1/src/app_clusters/WebRTC_Provider.adoc

And resulting output with the updates here: https://github.com/project-chip/connectedhomeip/blob/45216a86c1178f94a29688d114263e87321e8352/src/app/zap-templates/zcl/data-model/chip/web-rtc-provider-cluster.xml

Minor tweaks: 1) added the zcl.xsd schema to the output files so that XML editors (e.g. IDEs) are able to check correctness of XML files 2) made some minor fixes to output XML (use name attribute in domain as it's specified in XSD)

semanticdiff-com[bot] commented 1 month ago

Review changes with SemanticDiff.

Analyzed 18 of 18 files.

Overall, the semantic diff is 3% smaller than the GitHub diff.

Filename Status
:heavy_check_mark: zap/datatype.go Analyzed
:heavy_check_mark: zap/generate/cluster.go 69.82% smaller
:heavy_check_mark: zap/generate/configurator.go Analyzed
:heavy_check_mark: matter/cluster.go Analyzed
:heavy_check_mark: matter/sections.go Analyzed
:heavy_check_mark: matter/typedef.go Analyzed
:heavy_check_mark: matter/types/base.go Analyzed
:heavy_check_mark: matter/types/entity.go Analyzed
:heavy_check_mark: matter/spec/build.go Analyzed
:heavy_check_mark: matter/spec/cluster.go 13.87% smaller
:heavy_check_mark: matter/spec/datatypes.go 0.05% smaller
:heavy_check_mark: matter/spec/global.go Analyzed
:heavy_check_mark: matter/spec/section.go Analyzed
:heavy_check_mark: matter/spec/spec.go Analyzed
:heavy_check_mark: matter/spec/typedef.go Analyzed
:heavy_check_mark: errata/spec.go 0.81% smaller
:heavy_check_mark: db/datatypes.go Analyzed
:heavy_check_mark: db/schema.go Analyzed
gmarcosb commented 1 month ago

@hasty to review, @bzbarsky-apple asked me to reach out regarding adding this support @ https://github.com/project-chip/connectedhomeip/pull/35773