-
-
Notifications
You must be signed in to change notification settings - Fork 835
Description
There is a clang-tidy check tool, but no clang-format.
I see in many projects without any kind of autoformatter, and they end up with things like a mix of spaces and tab indentation, and other such annoyances.
I would really like to be able to add clang-format to projects so they can enforce a consistent style, but adding dependencies to random open source projects isn't always a good choice.
But if they're already using pio, and pio is already distributing clang-tidy, it seems like distributing clang-format through pio is the best way forward.
The platformio/tool-clangtidy package has a few random versions(llvm has had a lot more releases), some platform support(less than llvm), but there is no link to the source for the platformio package.
The lack of source is quite confusing.
Also, if I just add check_tool = clangtidy to my platformio.ini, pio will install the platformio/tool-clangtidy package 1.150005.0 containing clang-tidy 15.0.5 from 2022 instead of the latest pio package(1.190100.0, presumably containing clang-tidy 19.1.0 from 2024) I think because of dependencies.py?
It's reasonably important to let users choose which version of clang-format and clang-tidy they get, llvm tries to not do breaking changes, but different versions still do things different.
I think the order of operations should be:
- Y'all create a repo for platformio/tool-clangtidy
- Someone(probably me) makes a PR to automate releases so whenever llvm releases, we publish a new pio registry version of clang-format,
- Duplicate the repo for clang-format.
Could alternately have one repo handle both packages? It would mean that less duplication of the automation actions, which is nice, but also a little more confusing than a single source repo for each platformio package? - Someone makes a PR to add clang-format as a pio check tool.
- Think of how to let users choose version of clang-tidy and clang-format.
If it's just tied to pio release that's at least acceptable for now, when you update pio for your project you fight the linters a bit, and just make sure your CI and you use the same version of pio.