-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
368a8ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why the linter is failing on this commit... As usual my cpp formatting is probably off somewhere...
368a8ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I found where Github actually shows the error messages, which is nice, but the problem is I formatted using clang on VSCode and am not sure what the linter isn't running. If I try to use the clang executable from https://llvm.org/builds/ or on raspberry pi I get an error message about invalid arguments lol. Not sure how to match the formatting... @2bndy5 How are you formatting?
368a8ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format automatically looks for a .clang-format file (either in folder with source or a parent folder of the source). The .clang-format file is the linter's config file. Using a config file means we don't have to pass a customized
--style
arg to clang-format, but the--style
can still be used to override the options set in the config file.The version of clang-format used is actually very important as there are significant behavioral changes between clang versions. Our CI uses v12. You can find out what version you're running with
If clang-format v12 is installed (and should be added to
PATH
during install), then to formatting a file in CLIon Linux
on windows
368a8ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about upgrading clang-format to v14 (or newer) since Visual Studio Build Tools (essential to compiling C/C++ on Windows) expects a certain version of clang as a minimum supported version.
368a8ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed formatting in RF24Client.cpp. It was just some indentation changes, but it looks a bit confusing to the naked eye because the
else if
statement is spread out over 2 differently indented lines...I also modified the PIO CI triggers to run every time there are changes to the library source (at least the ones that aren't copied from the old UIP lib).
Should be good to release now. If you want to upgrade the clang-format version we use, raise an issue in our .github repo (because all our format checks are using the same reusable workflow, cpp_lint.yaml). The .clang-format files in our repos are all the same copied file, so I might have to update those.