Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Coding style documentation #36275

Merged
merged 13 commits into from
Nov 18, 2024
Merged

Conversation

cecille
Copy link
Contributor

@cecille cecille commented Oct 28, 2024

   - removed most of the motivation sections as it was somewhat
  repetitive and made the doc quite verbose
- removed the drawing because it doesn't match the SDK implementation
  in reality
- removed C discussion - I don't think we have any
- added python versions. Didn't add the other languages because I
  dont' know but other folks can easily add a follow up
- added sections on
  + formatters
  + anonymous namespaces for internal stuff in cpp files
  + singletons
  + std containers to heap allocation sections
  + CopySpanToMutableSpan
  + std::optional
  + python section
- removed the code samples from heap allocation because it implies
  that people show re-implement these things when the preference is
  to use the provided support classes
- removed the version table - we have git history.

Also changed from adoc to md, since that's why it was not showing up on the documentation site.

- removed most of the motivation sections as it was somewhat
  repetitive and made the doc quite verbose
- removed the drawing because it doesn't match the SDK implementation
  in reality
- removed C discussion - I don't think we have any
- added python versions. Didn't add the other languages because I
  dont' know but other folks can easily add a follow up
- added sections on
  + formatters
  + anonymous namespaces for internal stuff in cpp files
  + singletons
  + std containers to heap allocation sections
  + CopySpanToMutableSpan
  + std::optional
  + python section
- removed the code samples from heap allocation because it implies
  that people show re-implement these things when the preference is
  to use the provided support classes
- removed the version table - we have git history.
Copy link

semanticdiff-com bot commented Oct 28, 2024

Review changes with  SemanticDiff

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 28, 2024
Copy link

github-actions bot commented Oct 28, 2024

PR #36275: Size comparison from 813c245 to 6e49e9f

Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 813c245 6e49e9f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1349984 1349984 0 0.0
RAM 104120 104120 0 0.0
bl702 lighting-app bl702+eth FLASH 647380 647380 0 0.0
RAM 25233 25233 0 0.0
bl702+wifi FLASH 824944 824944 0 0.0
RAM 13965 13965 0 0.0
bl706+mfd+rpc+littlefs FLASH 1053678 1053678 0 0.0
RAM 23821 23821 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 974462 974462 0 0.0
RAM 16468 16468 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 836412 836412 0 0.0
RAM 123676 123676 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 821832 821832 0 0.0
RAM 125556 125556 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 768404 768404 0 0.0
RAM 114048 114048 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 752664 752664 0 0.0
RAM 114240 114240 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 626506 626506 0 0.0
RAM 206132 206132 0 0.0
lock CC3235SF_LAUNCHXL FLASH 666482 666482 0 0.0
RAM 206284 206284 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 678381 678381 0 0.0
RAM 78692 78692 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 698233 698233 0 0.0
RAM 81324 81324 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 698233 698233 0 0.0
RAM 81324 81324 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 655161 655161 0 0.0
RAM 73760 73760 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614829 614829 0 0.0
RAM 71644 71644 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634457 634457 0 0.0
RAM 74196 74196 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634457 634457 0 0.0
RAM 74196 74196 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 634181 634181 0 0.0
RAM 74692 74692 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 653897 653897 0 0.0
RAM 77244 77244 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 653897 653897 0 0.0
RAM 77244 77244 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609445 609445 0 0.0
RAM 68780 68780 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 629297 629297 0 0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 629297 629297 0 0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 925516 925516 0 0.0
RAM 159920 159920 0 0.0
BRD4338a FLASH 741256 741256 0 0.0
RAM 232580 232580 0 0.0
window-app BRD4187C FLASH 1017480 1017480 0 0.0
RAM 128264 128264 0 0.0
esp32 all-clusters-app c3devkit DRAM 95256 95256 0 0.0
FLASH 1538746 1538746 0 0.0
IRAM 82538 82538 0 0.0
m5stack DRAM 116192 116192 0 0.0
FLASH 1548958 1548958 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2735565 2735565 0 0.0
RAM 129520 129520 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 6037838 6037838 0 0.0
RAM 523840 523840 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5370462 5370462 0 0.0
RAM 242416 242416 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4703992 4703992 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 12979326 12979326 0 0.0
RAM 584466 584466 0 0.0
chip-tool-ipv6only arm64 unknown 21416 21416 0 0.0
FLASH 11114536 11114536 0 0.0
RAM 635408 635408 0 0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11309149 11309149 0 0.0
RAM 584954 584954 0 0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4530424 4530424 0 0.0
RAM 205336 205336 0 0.0
fabric-sync debug unknown 4840 4840 0 0.0
FLASH 5242917 5242917 0 0.0
RAM 465416 465416 0 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5645089 5645089 0 0.0
RAM 228488 228488 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4752870 4752870 0 0.0
RAM 204472 204472 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4379642 4379642 0 0.0
RAM 198192 198192 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4518682 4518682 0 0.0
RAM 202760 202760 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3064061 3064061 0 0.0
RAM 160368 160368 0 0.0
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4122680 4122680 0 0.0
RAM 242896 242896 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 5979365 5979365 0 0.0
RAM 596256 596256 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 1118631 1118631 0 0.0
RAM 694536 694536 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 914360 914360 0 0.0
RAM 143357 143357 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 885896 885896 0 0.0
RAM 141496 141496 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 847928 847928 0 0.0
RAM 142265 142265 0 0.0
nxp contact k32w0+release FLASH 582296 582296 0 0.0
RAM 71092 71092 0 0.0
mcxw71+release FLASH 596776 596776 0 0.0
RAM 63184 63184 0 0.0
light k32w0+release FLASH 618900 618900 0 0.0
RAM 70556 70556 0 0.0
k32w1+release FLASH 682992 682992 0 0.0
RAM 48816 48816 0 0.0
lock mcxw71+release FLASH 746576 746576 0 0.0
RAM 67340 67340 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1643620 1643620 0 0.0
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1550588 1550588 0 0.0
RAM 209208 209208 0 0.0
light cy8ckit_062s2_43012 FLASH 1466564 1466564 0 0.0
RAM 201200 201200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1464004 1464004 0 0.0
RAM 225560 225560 0 0.0
qpg lighting-app qpg6105+debug FLASH 660392 660392 0 0.0
RAM 105420 105420 0 0.0
lock-app qpg6105+debug FLASH 618468 618468 0 0.0
RAM 99880 99880 0 0.0
stm32 light STM32WB5MM-DK FLASH 481680 481680 0 0.0
RAM 144844 144844 0 0.0
telink bridge-app tlsr9258a FLASH 680902 680902 0 0.0
RAM 91304 91304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 620500 620500 0 0.0
RAM 50600 50600 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 708438 708438 0 0.0
RAM 73940 73940 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625344 625344 0 0.0
RAM 144468 144468 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811354 811354 0 0.0
RAM 99100 99100 0 0.0
tizen all-clusters-app arm unknown 4912 4912 0 0.0
FLASH 1720944 1720944 0 0.0
RAM 90108 90108 0 0.0
chip-tool-ubsan arm unknown 10792 10792 0 0.0
FLASH 18157782 18157782 0 0.0
RAM 7915456 7915456 0 0.0

docs/style/CODING_STYLE_GUIDE.md Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Oct 29, 2024

PR #36275: Size comparison from 813c245 to 585534f

Full report (68 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 813c245 585534f change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1349984 1349306 -678 -0.1
RAM 104120 104120 0 0.0
bl702 lighting-app bl702+eth FLASH 647380 647028 -352 -0.1
RAM 25233 25233 0 0.0
bl702+wifi FLASH 824944 824592 -352 -0.0
RAM 13965 13965 0 0.0
bl706+mfd+rpc+littlefs FLASH 1053678 1053582 -96 -0.0
RAM 23821 23821 0 0.0
bl702l lighting-app bl702l+mfd+littlefs FLASH 974462 974366 -96 -0.0
RAM 16468 16468 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 836412 836124 -288 -0.0
RAM 123676 123676 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 821832 821768 -64 -0.0
RAM 125556 125556 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 768404 768476 72 0.0
RAM 114048 114048 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 752664 752720 56 0.0
RAM 114240 114240 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 626506 625798 -708 -0.1
RAM 206132 206132 0 0.0
lock CC3235SF_LAUNCHXL FLASH 666482 665774 -708 -0.1
RAM 206284 206284 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 678381 678085 -296 -0.0
RAM 78692 78692 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 698233 697937 -296 -0.0
RAM 81324 81324 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 698233 697937 -296 -0.0
RAM 81324 81324 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 655161 654873 -288 -0.0
RAM 73760 73760 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614829 614637 -192 -0.0
RAM 71644 71644 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634457 634273 -184 -0.0
RAM 74196 74196 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634457 634273 -184 -0.0
RAM 74196 74196 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 634181 634149 -32 -0.0
RAM 74692 74692 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 653897 653857 -40 -0.0
RAM 77244 77244 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 653897 653857 -40 -0.0
RAM 77244 77244 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609445 609429 -16 -0.0
RAM 68780 68780 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 629297 629281 -16 -0.0
RAM 71412 71412 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 629297 629281 -16 -0.0
RAM 71412 71412 0 0.0
efr32 lock-app BRD4187C FLASH 925516 926068 552 0.1
RAM 159920 159920 0 0.0
BRD4338a FLASH 741256 740568 -688 -0.1
RAM 232580 232580 0 0.0
window-app BRD4187C FLASH 1017480 1017272 -208 -0.0
RAM 128264 128264 0 0.0
esp32 all-clusters-app c3devkit DRAM 95256 95256 0 0.0
FLASH 1538746 1537464 -1282 -0.1
IRAM 82538 82538 0 0.0
m5stack DRAM 116192 116192 0 0.0
FLASH 1548958 1548126 -832 -0.1
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2735565 2731595 -3970 -0.1
RAM 129520 129616 96 0.1
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 6037838 6021350 -16488 -0.3
RAM 523840 523872 32 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5370462 5358592 -11870 -0.2
RAM 242416 242448 32 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4703992 4700450 -3542 -0.1
RAM 218384 218400 16 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 12979326 12901220 -78106 -0.6
RAM 584466 584466 0 0.0
chip-tool-ipv6only arm64 unknown 21416 21416 0 0.0
FLASH 11114536 11029376 -85160 -0.8
RAM 635408 635400 -8 -0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11309149 11308753 -396 -0.0
RAM 584954 584922 -32 -0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4530424 4527502 -2922 -0.1
RAM 205336 205368 32 0.0
fabric-sync debug unknown 4840 4840 0 0.0
FLASH 5242917 5239621 -3296 -0.1
RAM 465416 465432 16 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5645089 5638961 -6128 -0.1
RAM 228488 228520 32 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4752870 4748870 -4000 -0.1
RAM 204472 204520 48 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4379642 4375630 -4012 -0.1
RAM 198192 198240 48 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4518682 4513870 -4812 -0.1
RAM 202760 202808 48 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3064061 3048605 -15456 -0.5
RAM 160368 160336 -32 -0.0
thermostat-no-ble arm64 unknown 9456 9456 0 0.0
FLASH 4122680 4117192 -5488 -0.1
RAM 242896 242936 40 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 5979365 5971893 -7472 -0.1
RAM 596256 596304 48 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 1118631 11108589 -77728 -0.7
RAM 694536 694552 16 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 914360 913336 -1024 -0.1
RAM 143357 143357 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 885896 884780 -1116 -0.1
RAM 141496 141496 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 847928 847396 -532 -0.1
RAM 142265 142265 0 0.0
nxp contact k32w0+release FLASH 582296 582296 0 0.0
RAM 71092 71092 0 0.0
mcxw71+release FLASH 596776 596784 8 0.0
RAM 63184 63184 0 0.0
light k32w0+release FLASH 618900 618852 -48 -0.0
RAM 70556 70556 0 0.0
k32w1+release FLASH 682992 682936 -56 -0.0
RAM 48816 48816 0 0.0
lock mcxw71+release FLASH 746576 746560 -16 -0.0
RAM 67340 67340 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1643620 1641508 -2112 -0.1
RAM 212408 212408 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1550588 1549052 -1536 -0.1
RAM 209208 209208 0 0.0
light cy8ckit_062s2_43012 FLASH 1466564 1465636 -928 -0.1
RAM 201200 201200 0 0.0
lock cy8ckit_062s2_43012 FLASH 1464004 1463300 -704 -0.0
RAM 225560 225560 0 0.0
qpg lighting-app qpg6105+debug FLASH 660392 660304 -88 -0.0
RAM 105420 105420 0 0.0
lock-app qpg6105+debug FLASH 618468 618380 -88 -0.0
RAM 99880 99880 0 0.0
stm32 light STM32WB5MM-DK FLASH 481680 481392 -288 -0.1
RAM 144844 144844 0 0.0
telink bridge-app tlsr9258a FLASH 680902 680800 -102 -0.0
RAM 91304 91304 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 620500 620426 -74 -0.0
RAM 50600 50600 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 708438 708260 -178 -0.0
RAM 73940 73940 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625344 625062 -282 -0.0
RAM 144468 144468 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811354 811072 -282 -0.0
RAM 99100 99100 0 0.0
tizen all-clusters-app arm unknown 4912 4912 0 0.0
FLASH 1720944 1712792 -8152 -0.5
RAM 90108 90140 32 0.0
chip-tool-ubsan arm unknown 10792 10792 0 0.0
FLASH 18157782 1794227 -215512 -1.2
RAM 7915456 7811564 -103892 -1.3

docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
docs/style/CODING_STYLE_GUIDE.md Outdated Show resolved Hide resolved
@cecille cecille marked this pull request as ready for review November 14, 2024 22:07
@mergify mergify bot merged commit 83828f5 into project-chip:master Nov 18, 2024
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation github review - approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants