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

[cli] style fixes & remove core defined error constants #9868

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

abtink
Copy link
Member

@abtink abtink commented Feb 21, 2024

This commit contains small changes in the CLI modules:

  • Replace use of core-internal kError with OT_ERROR constants.
  • Remove #endif comments when the corresponding #if is less than 20 lines away adhering to OT style guide.
  • Adhere to single return policy (use ExitNow()).
  • Avoid calling static method ParseToIp6Address() with an object.
  • Smaller style fixes: New lines after variable declaration, use shorter local variable names, etc.

This commit contains small changes in the CLI modules:

- Replace use of core-internal `kError` with `OT_ERROR` constants.
- Remove `#endif` comments when the corresponding `#if` is less
  than 20 lines away adhering to OT style guide.
- Adhere to single `return` policy (use `ExitNow()`).
- Avoid calling `static` method `ParseToIp6Address()` with an object.
- Smaller style fixes: New lines after variable declaration, use
  shorter local variable names, etc.
Copy link

size-report bot commented Feb 21, 2024

Size Report of OpenThread

Merging #9868 into main(3aa3cbc).

name branch text data bss total
ot-cli-ftd main 465520 760 66332 532612
#9868 465504 760 66332 532596
+/- -16 0 0 -16
ot-ncp-ftd main 435508 760 61544 497812
#9868 435508 760 61544 497812
+/- 0 0 0 0
libopenthread-ftd.a main 234709 0 40278 274987
#9868 234709 0 40278 274987
+/- 0 0 0 0
libopenthread-cli-ftd.a main 56927 0 8075 65002
#9868 56915 0 8075 64990
+/- -12 0 0 -12
libopenthread-ncp-ftd.a main 31855 0 5916 37771
#9868 31855 0 5916 37771
+/- 0 0 0 0
ot-cli-mtd main 364544 760 51220 416524
#9868 364528 760 51220 416508
+/- -16 0 0 -16
ot-ncp-mtd main 347196 760 46448 394404
#9868 347196 760 46448 394404
+/- 0 0 0 0
libopenthread-mtd.a main 157973 0 25182 183155
#9868 157973 0 25182 183155
+/- 0 0 0 0
libopenthread-cli-mtd.a main 39751 0 8059 47810
#9868 39739 0 8059 47798
+/- -12 0 0 -12
libopenthread-ncp-mtd.a main 24735 0 5916 30651
#9868 24735 0 5916 30651
+/- 0 0 0 0
ot-cli-ftd-br main 534056 768 131004 665828
#9868 534040 768 131004 665812
+/- -16 0 0 -16
libopenthread-ftd-br.a main 297894 5 104926 402825
#9868 297894 5 104926 402825
+/- 0 0 0 0
libopenthread-cli-ftd-br.a main 70560 0 8099 78659
#9868 70548 0 8099 78647
+/- -12 0 0 -12
ot-rcp main 62232 564 20604 83400
#9868 62232 564 20604 83400
+/- 0 0 0 0
libopenthread-rcp.a main 9534 0 5052 14586
#9868 9534 0 5052 14586
+/- 0 0 0 0
libopenthread-radio.a main 18815 0 214 19029
#9868 18815 0 214 19029
+/- 0 0 0 0

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (3aa3cbc) 82.32% compared to head (31da8ab) 83.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9868      +/-   ##
==========================================
+ Coverage   82.32%   83.45%   +1.13%     
==========================================
  Files         560      560              
  Lines       74979    78965    +3986     
==========================================
+ Hits        61723    65903    +4180     
+ Misses      13256    13062     -194     
Files Coverage Δ
src/cli/cli.hpp 100.00% <ø> (ø)
src/cli/cli_dns.cpp 63.15% <100.00%> (-5.24%) ⬇️
src/cli/cli_ping.cpp 91.30% <100.00%> (-3.44%) ⬇️
src/cli/cli_udp.cpp 88.40% <100.00%> (-6.68%) ⬇️
src/cli/cli.cpp 72.99% <66.66%> (-0.33%) ⬇️
src/cli/cli_tcp.cpp 54.41% <80.00%> (+16.05%) ⬆️

... and 280 files with indirect coverage changes

@jwhui jwhui merged commit a0d805c into openthread:main Feb 22, 2024
100 checks passed
superwhd added a commit to superwhd/openthread that referenced this pull request Sep 2, 2024
Bug: 320820261

* github/main:
  [cli-tcat] define `VendorInfo` as a member variable (openthread#9869)
  [cli] style fixes & remove core defined error constants (openthread#9868)
  [ip6] add multicast forwarding restrictions to host (openthread#9863)
  [netdiag] update comments and fix style (openthread#9866)
  [cli] add references to CoAP concepts guide from CLI (openthread#9856)
  [netdiag] add support for Vendor App URL TLV (openthread#9816)
  [tools] add missing tcat ble client files (openthread#9857)
  [mle] generate challenge for "Child Update Request" early (openthread#9850)
  [mbedtls] make debug logging independent from builtin (openthread#9848)
  [cli] update coaps readme (openthread#9849)
  [slaac] implement address deprecation mechanism (openthread#9585)
  [cli] add Doxygen tags for coaps commands (openthread#9837)
  [instance] init `BackboneRouter::Local` before `Mle` (openthread#9843)
  [csl] reset data poll timer after successful csl transmission (openthread#9840)
  github-actions: bump actions/setup-python from 4.7.1 to 5.0.0 (openthread#9845)
  Bump grpcio from 1.53.0 to 1.53.2 in /tools/harness-simulation/harness (openthread#9842)
  [srp] implement `AdvertisingProxy` and define `Dnssd` platform APIs (openthread#9268)
  [tools] add tcat ble client (openthread#9739)
  [mbedtls] update to 2.28.7 (openthread#9835)
  [ip6] simplify `Ip6::SelectSourceAddress()` (openthread#9832)
  [cli] add Doxygen tags to CoAP commands (openthread#9821)
  [ip6] mesh-local addresses as preferred, platform control flag on host stack (openthread#9815)
  github-actions: bump step-security/harden-runner from 2.6.1 to 2.7.0 (openthread#9831)
  [ip6] `SelectSourceAddress()` rule 1 on preferring same address (openthread#9830)
  [posix] do not enable loop back to host (openthread#9826)
  [ip6] always deliver multicast to host (openthread#9824)
  [ncp] set message origin to host untrusted (openthread#9825)
  [trel] fix typo in `OPENTHREAD_CONFIG_TREL_PEER_TABLE_SIZE` (openthread#9823)
  [ci] fix artifact name conflict (openthread#9827)
  [routing-manager] fix `IsDeprecated()` to handle large preferred lifetime (openthread#9822)
  [common] add `ClearAllBytes()` template function (openthread#9818)
  [netdata-publisher] remove SRP unicast on anycast entry added by a BR (openthread#9807)
  [codecov] enable use of `CODECOV_TOKEN` (openthread#9819)
  [spinel] allow registering callback to restore vendor properties (openthread#9773)
  [key-manager] check if the key is present before exporting the key (openthread#9814)
  [cli] commissioner commands (openthread#9798)
  [spinel] fix set rx on when idle for RCP (openthread#9812)
  [net-diag] add Eui64Tlv support (openthread#9795)
  github-actions: bump github/codeql-action from 2.22.5 to 3.23.2 (openthread#9810)
  [multipan] Fix for multipan use case to handle tx timeout. (openthread#9781)
  [coap-secure] fix and test to validate max connection attempt limit (openthread#9803)
  [ip6] add method for creating/parsing IPv4-mapped IPv6 address (openthread#9799)
  [coap-secure] introduce maximum connection attempt limit for CoAP agent (openthread#9694)
  [border-agent] enable `otBorderAgentGetId` API when Border Agent is enabled (openthread#9794)
  [spinel] fix passing an unexpected transmit error to mac layer (openthread#9745)
  [docs] add TREL config group (openthread#9791)
  [cli] use `static constexpr` for constants instead of of `enum` (openthread#9789)
  [radio] add API for resetting CSL parameters (openthread#9772)
  github-actions: bump actions/upload-artifact from 3.1.3 to 4.2.0 (openthread#9788)
  [posix] use /dev/socket/ot-daemon for OT daemon socket (openthread#9776)
  [posix] fix netlink address deletion on posix (openthread#9779)
  [github-actions] remove use of geekyeggo/delete-artifact (openthread#9785)
  [net-diag] handle `MleCounterTlv` in `AppendDiagTlv()` (openthread#9777)
  [github-actions] add write permissions for geekyeggo/delete-artifact (openthread#9780)
  github-actions: bump geekyeggo/delete-artifact from 2.0.0 to 4.1.0 (openthread#9774)
  [github-actions] bump actions/upload-artifact and actions/download-artifact (openthread#9769)
  [tcat] define config defaults (openthread#9768)
  [posix] only add IPv4 route if NAT64 is enabled (openthread#9762)
  [srp] simplify crypto `ReadOrGenerateKey` in srp client (openthread#9764)
  [cli] add pd state (openthread#9757)
  [dtls] fix `OPENTHREAD_CONFIG_DTLS_ENABLE` check (openthread#9767)
  [test] move heap plat APIs in unit test under `extern "C"` block (openthread#9766)
  [srp] update config for auto-start mode to be enabled by default (openthread#9738)
  [ncp] differentiate DETACHED role and DISABLED role (openthread#9760)
  [docs] add Aqara to who supports list (openthread#9758)
  [cli] separate ping sender as a module (openthread#9756)
  [docs] fixed some common typos (openthread#9752)
  [telemetry] add API for TREL telemetry (openthread#9710)
  Bump pycryptodome from 3.17 to 3.19.1 in /tests/scripts/thread-cert (openthread#9755)
  [trel] add config for peer table size and packet pool size (openthread#9750)
  [cli] add Doxygen tags for history commands (openthread#9751)
  [telemetry] add upstream DNS metrics (openthread#9729)
  [dns] add `Name::ComapreMultipleLabels()` and update `Matches()` (openthread#9744)
  [dns] clarify trailing dot in `Name::ExtractLabels()` (openthread#9743)
  [heap-data] add `Matches()` to compare `Heap::Data` with a given buffer (openthread#9740)
  [posix] ignore required anycast address (openthread#9717)
  [cmake] always define `OPENTHREAD_FTD/MTD/RADIO` (openthread#9733)
  [dns] add `Name::Matches()` to compare DNS names (openthread#9734)
  [docs] create config variables list (openthread#9721)
  [factory-diags] fix usage of `OPENTHREAD_RADIO` (openthread#9736)
  [spinel] add spinel net role DISABLED (openthread#9731)
  [dns-types] add template variants of reading DNS names or labels (openthread#9720)
  [github-actions] avoid `dependabot` pull requests in forks (openthread#9728)
  [config] fix typos in config docs (openthread#9725)
  [spinel] fix `OPENTHREAD_ENABLE_SPINEL_VENDOR_HOOK` (openthread#9718)
  github-actions: bump docker/login-action from 2.2.0 to 3.0.0 (openthread#9723)
  [posix] prevent implicit conversion of `aUrl` to `RadioUrl` (openthread#9722)
  [posix] fix circular dependency on `OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE` (openthread#9719)
  [posix] fix usage of `__linux__` (openthread#9714)
  [docs] reference groups added and typos fixed (openthread#9709)
  [cmake] config posix config file runtime location (openthread#9701)
  [cmake] posix platform runtime configuration file (openthread#9701)
  [cmake] platform power calibration enable (openthread#9701)
  [posix] verify in `otPlatUdpBindToNetif` if Backbone Interface is set. (openthread#9696)
  [unit-test] make sure `otPlatLog()` is defined as `extern "C"` (openthread#9711)
  [routing-manager] advertise local OMR in RA after present in netdata (openthread#9703)
  [cli] add aliases for TCP and SRP concepts guides (openthread#9707)
  [routing-manager] deprecate OMR/on-mesh prefixes when removed from netdata (openthread#9599)
  github-actions: bump actions/setup-go from 4.1.0 to 5.0.0 (openthread#9706)
  [docs] SRP README update minor fix (openthread#9702)
  [cli] add `debug` command (openthread#9587)
  [github-actions] add arm-gcc-13 to build check (openthread#9695)
  [secure-transport] add `SetState()` and log state changes (openthread#9692)
  [mle] fix uninitialized `mLinkRequestAttempts` (openthread#9689)
  [tests] reduce flakiness of `test_publish_meshcop_service.py` (openthread#9690)
  [coap] remove duplicate method for setting `ConnectedCallback` (openthread#9691)
  [spinel] make `kTxWaitUs` configurable during compile time (openthread#9687)
  [secure-transport] rename `HandleUdpReceive` to `HandleReceive` (openthread#9686)
  [mesh-forwarder] finalize message direct tx on drop or eviction (openthread#9682)
  [meshcop-tlvs] simplify and enhance `ChannelMaskTlv` (openthread#9675)
  [tests] rename `get_netdata_nat64_prefix()` to `get_netdata_nat64_routes()` (openthread#9678)
  [posix] expose `platformInfraIfIsRunning()` as `otSysInfraIfIsRunning()` (openthread#9672)
  [telemetry] add api for DHCPv6 PD telemetry (openthread#9645)
  [crypto] remove PSA mbedtls hybrid setup of PBKDF2 function (openthread#9655)
  [crypto] add error handling to PBDF2 generate key function (openthread#9655)
  [tcat] initial commit of bluetooth-based commissioning (openthread#9210)
  [spinel] add vendor hook for the spinel host side (openthread#9560)
  github-actions: bump actions/setup-python from 4.7.0 to 4.7.1 (openthread#9677)
  [meshcop] `MeshCoP::ChannelTlv` to utilize `Mle::ChannelTlvValue` (openthread#9674)
  [srp-client] track registered addresses (openthread#9652)
  [cli] SRP Server Readme update - add srp server auto command (openthread#9669)

Change-Id: I6e9fbc4555569983cc8b8e3d1d03c2f2c82b6b9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants