Open pauldreik opened 1 week ago
Sure. E.g., we could adopt the following:
https://github.com/search?q=repo%3Afastfloat%2Ffast_float+clang-format&type=code
My key objection against clang-format in general is that it is clang version dependent. So you must require a fixed version of clang-format. Thankfully, this can be done with docker.
Pull request invited.
The code is sometimes inconsistently formatted. That does not bother me.
However, when developing, it is very convenient if one can use auto formatting. I also think it leads to cleaner pull requests since unrelated white space changes are less likely to occur. It is also easier for contributors to adhere to the code style without effort (most IDE-s support formatting).
This comes up now when working with the span interface - it would be nice to have some kind of machine enforceable formatting in place before I start.
The established practice is to have a .clang-format checked in at the root level. There is already one for the fuzzer subdirectory.
The downsides:
I suggest to introduce a CI job which checks the formatting. In case there is a formatting failure, the job fails and a suggested diff is output which can be applied with git apply.
The suggestion is: