Clang-format version requirement on MacOS

The corryvreckan git requires clang-format version 12 on MacOS. I have version 14. Does it really have to be version 12 or can the scripts be changed to look for version 12 and above?
Thanks
Fergus

Hi @fwilson

sorry for the belated answer… We require a specific version of clang-format because in the past. formatting has differed quite a bit between versions. However, I feel your pain, not all systems ship different versions of it. I am relatively certain, that on MacOS also version14 should produce good results, so just change the version searched for in the main CMakeLists.txt file:

# Set the clang-format version required by the CI for correct formatting:
SET(CLANG_FORMAT_VERSION "14")

Let me know how that goes!

/Simon

Hi Simon
Thanks for the heads up. We tried that, but it turned out that the branched version would use git-magic (not a tool, just a compound word, but it should be) to look up the CMakeLists entry in the master branch…
We have now edited both master and the branch version on Fergus’ setup and that fixes things - if there is no specific version requirement, any point in setting it to a minimum version?
Best,
Jens

Hi @jdopke

I believe that there were no substantial changes introduced to the formatting when we switched from 11 to 12, so maybe set 11 as the minimal requirement?

/Simon

Was more thinking in the master branch - it works for Fergus now. Need to figure out how to generate a minimal version requirement, as there are a few checks that seem to be based on grep results (for a specific version), rather than numeric evaluation - will come back if I happen to find a good answer over the long weekend.