OpenCyphal / libcanard

A compact implementation of the Cyphal/CAN protocol in C for high-integrity real-time embedded systems
http://opencyphal.org
MIT License
326 stars 192 forks source link

Expose CanardRxSubscription #167

Closed PetervdPerk-NXP closed 3 years ago

PetervdPerk-NXP commented 3 years ago

As discussed in https://forum.uavcan.org/t/libcanard-listing-active-canardrxsubscription/1266

pavel-kirienko commented 3 years ago

Please run make format in your CMake binary dir to fix CI

PetervdPerk-NXP commented 3 years ago

Please run make format in your CMake binary dir to fix CI

Tried that, which version of clang-format is the CI runing maybe that's the issue.

hovergames@hovergames:/tmp/libcanard/tests/build$ make format
Formatting /tmp/libcanard/tests/../libcanard/canard.c
YAML:15:38: error: invalid boolean
AllowShortIfStatementsOnASingleLine: Never
                                     ^~~~~
Error reading /tmp/libcanard/tests/../.clang-format: Invalid argument
Formatting /tmp/libcanard/tests/../libcanard/canard.h
YAML:15:38: error: invalid boolean
AllowShortIfStatementsOnASingleLine: Never
                                     ^~~~~

EDIT: Found it I needed to install clang-12 Have to force the symlink of clang-format to 12 so it doesn't take version 6 though

pavel-kirienko commented 3 years ago

The docs say that you need v11 or newer, yes: https://github.com/UAVCAN/libcanard/blob/master/CONTRIBUTING.md#tools

PetervdPerk-NXP commented 3 years ago

Pushed a new commit, although clang-format-12 seems to be changing formatting of other parts as well

https://github.com/UAVCAN/libcanard/pull/167/files#diff-2cf2cbe80f83756b41a08c76c014cc84c5ea7a2416150e5e45c0c1c4b4986da6R70

pavel-kirienko commented 3 years ago

Sigh. Can you try v11 then, please? A better option though is to update the settings to prevent breakage due to different versions having different default settings.

PetervdPerk-NXP commented 3 years ago

Using clang-format-11 solves it indeed.