apt-sim/AdePT

adding .clang_format

agheata opened this issue · 3 comments

We should add a .clang_format style and enforce usage of clang_format as action. So we should decide first on the style and minimum clang-format version. We can use the style we use in VecGeom, with 2 spaces indentation, column limit of 120, replace tab with 2 spaces, .... We also have some scripts allowing to check/apply locally clang-format to all files touched in a branch.

Any opinions on the style/version?

The most important thing is consistency, IMO. Personally I like the Google code style. I concur with 2 character intents that should be spaces (ban tabs).

CentOS8 has clang-format v9 so I suggest that as the minimum version. Ubuntu20 comes with clang-format 10, which is maybe a good one for the CI itself:

I'd go with the VecGeom/VecCore one for consistency with those projects (given the overlap in people), can always easily change later!

Concur with Graeme on the min version and and CI integration. I'm happy to look at/integrate this, but want to look at PR #9 and the fisher price branch first!

OK, thanks Ben, agreed then. The PR introducing .clang-format should also preferably come with the .h, .cpp and .cu files formatted appropriately.