libCEED
libCEED copied to clipboard
clang-format
Ratel and PETSc have both moved to clang-format and I'm starting to feel envious when working on libCEED. Shall we do it? And if so, what config should we use? For reference:
- https://gitlab.com/micromorph/ratel/-/blob/main/.clang-format
- https://gitlab.com/petsc/petsc/-/blob/main/.clang-format
I'm +1 to converting to Clang format. I'm personally biased a bit towards the Ratel format. I tried to keep it pretty lightweight and close to the defaults. However, I'm just happy to move to a better formatting tool.
The not perfectly automated step to doing this will be to switch from ierr = f(); CeedChk(ierr); to CeedChk(f()); style.
Yeah, that took some fiddling with a find and replace followed by a lot of manual edits in Ratel. Boring but time consuming if there's somebody who would benefit from a tour of the codebase?
I'm happy with Ratel style. I think @Jacobfaib may have more robust automation for that conversion (CHKERRQ to PetscCall).
Yeah, see share/petsc/chkerrconvert.py. Note however that its' pretty PETSc-focused, that is it converts CHKERR<T> to PetscCall<T>. You'd have to modify the script to get it to do what you want here