azure-sdk-for-c
azure-sdk-for-c copied to clipboard
CLang-Format version (clang-format-9 does not exist in Ubuntu 22)
CI Fails with CLang format running version 9:
clang-format version 9.0.0-2~ubuntu18.04.2 (tags/RELEASE_900/final)
M sdk/tests/iot/hub/test_az_iot_hub_client_properties.c
Some files were not formatted correctly according to the .clang-format file.
Please run clang-format to fix the issue by using this bash command at the root of the repo:
find . \( -iname '*.h' -o -iname '*.c' \) -exec clang-format -i {} \;
On my Ubuntu 20.04, clang-format has version 10.0.0-4ubuntu1 and it has slightly different format.
This is to track:
- Documentation is updated to specify what version of CLang to use.
- The bash script should specify the CLang version
Feature branch attempt: https://github.com/Azure/azure-sdk-for-c/pull/2178/files
Clang-format-9 does not exist in Ubuntu 22. It's probably best to change the formatter to a newer version.
For reference, installing from the llvm package repositories might be a viable workaround (that I have not tested): https://stackoverflow.com/questions/20756924/how-can-i-install-clang-format-in-ubuntu
For reference, installing from the llvm package repositories might be a viable workaround (that I have not tested): https://stackoverflow.com/questions/20756924/how-can-i-install-clang-format-in-ubuntu
Yeah, I tried doing that but even when I get the repositories from the llvm , clang-format-9 does not come...It starts from clang 11.
On the other hand, I have a .gz file that has clang-format-9 in it. I tried pasting it in the root directory but it does not seem to recognize it from there, do you know how to proceed with that?
Go ahead and move the clang formatter up to the version that's most right for you in archetype-sdk-client.yml
. Some files may be altered when running clang-format so the process would be (includes links to engsys stuff):
- Update clang-format in archetype-sdk-client.yml (include installation config here)
- Run clang-format on locally using the expected version
- Review and commit source changes and archetype-sdk-client.yml changes
- Push and open PR, ensure that
clang-format --version
is outputting the expected versions
The pipeline should pass and you'll probably be good to merge.