mp-units
mp-units copied to clipboard
Test/clang format
@mpusz This is a draft running the pre-commit check for clang format 15 in the CI. Right now the check fails, since I did not apply the changes so far.
The branch is based on #341, hence it should be merged after #341
I am not sure if we should require contributors to push correctly formatted files or should they be automatically formatted on push... The problem is that it will take a long time for clang-format-15
to be officially released and not everyone may have an access to use it today (i.e. on Windows).
I will try to update the GitPod environment to include clang-format-15
so at least the contributors will be able to use the Gitpod environment with no issues.
Right. I also thought about possible options here.
The ideal solution would be pre-commit.ci which is free for open source projects and contains a bit the pushes auto fixes if the ci fails. Unfortunately we cannot configure the environment here, so we have to wait until clang-format is officially released.
What I did locally to apply the format without causing conflicts with my actual clang-format was creating a docker image. But not sure if this can be nicely integrated with pre-commit. But users without clang-format 15 could at least format their code.
Or would it be make sense to provide clang-format 15 as Conan package?
How should we proceed with clang-format?
I found that https://github.com/scop/pre-commit-shfmt/blob/main/.pre-commit-hooks.yaml#L11 use a docker image for running their shell formatter, so we could try to do a similar thing with clang-format. Maybe this is also interesting for other project using C++20
Well, I am not sure. I care about clang-format much more than CMake, which I still find inferior to manually written scripts. clang-format gives more value so we should use it for sure. However, I do not want to raise the bar too high for contributors as they may not be able to use clang-format-15 for now.
At least GitPod is ready and everyone can use it to develop and format the code...