Suppose that I have a set of libraries, that a few of us work on, and that I would like to clean up their formatting, such that things like tabs/spacing are correct and consistent... I am trying to decide what approach to take to do this.
In the past I needed to do this whenever I made contributions to the Adafruit libraries as their libraries are setup such that they must pass through a checker without warnings before the files could be merged..
I used their instructions and installed the windows LLVM version, which is currently version 12.0.0
I was able to reformat the code using this, after I created a custom .clang-format file which turned off sorting of include files....
Earlier I tried the version that you can have Visual Studio 2022 community edition installer install, which is 17.0.3, was having issues that the code would not compile after running it through this. One issue was the changing of the locations of the include files within a file. Some header files have dependencies on having other header files included before them. Yes, should fix these files...
I'm not sure I understand what you mean by this. I'm certain it won't fix the problem you are having with the #include directive sorting. For that, the solution (other than the ideal one of fixing the dependency mess) is to configure ClangFormat so it doesn't do that.
My advice would be to check whether you can set up whatever editor you are using for the libraries to use ClangFormat and the appropriate configuration file to format C and C++ code.
If your editor can't provide such a capability, just run ClangFormat directly on the files from the command line.
It is 14.0.0. You can determine which version of ClangFormat is used by Arduino IDE by checking the arduino.clangd.version field of the arduino-ide-extension/package.json file:
(the value is used for bundling both the clangd and ClangFormat tools when packaging Arduino IDE)
The tutorial just links to the latest version of the ClangFormat documentation. Although that is not ideal, the alternative of pointing the link to the documentation for the version in use at the time of writing the tutorial would likely result in the tutorial becoming outdated over time as it is not kept in sync with the development in Arduino IDE.
But so far holding off, as I also edit other things like: Teensy source files and the like, and in many of these cases, try to limit the number of things changed to simply what I changed to add or fix something.
Currently now working with default .clang-format settings. Fixed the library order stuff in the source code. Not sure I like that it does that, but...