hermes-3 icon indicating copy to clipboard operation
hermes-3 copied to clipboard

We should have clang-format in CI

Open mikekryjak opened this issue 6 months ago • 2 comments

As per the title. It's currently only applied by Ben - I didn't actually know we were supposed to do that until recently!

mikekryjak avatar Jun 09 '25 10:06 mikekryjak

+1 We could also add black for the Python files and cmake-format at the same time?

If you're a VSCode user, there are extensions for clang-format, cmake-format and black that can be set up to format on save.

One other consideration is how to preserve the git blame history when you bulk re-format all the source files. Adding a .git-blame-ignore-revs containing the format commit hash(es) is probably about as good as you can do, I think.

oparry-ukaea avatar Aug 11 '25 08:08 oparry-ukaea

We have this in BOUT++: https://github.com/boutproject/BOUT-dev/blob/master/.github/workflows/clang-format.yml There is a small downside: running this in PRs can hide test failures, which is a bit annoying. The other options are to run it as a test, failures require the user to run clang-format etc manually; or to run it automatically, but only on main.

ZedThree avatar Aug 19 '25 13:08 ZedThree