Coding style verification and fix as continuous integration
@Jehan
Submitted by Jehan Link to original bug (#770289)
Description
It seems it would be possible to have automatic verification and even reformating of patches. This could be done as pre-commit hooks and the candidate tool would be Clang-Format: http://clang.llvm.org/docs/ClangFormat.html
Now the steps would be:
-
formalize all our actual coding style rules. The HACKING file only states we use GNU coding style while we actually have specificities here and there.
-
Clean our existing code.
-
Have a stable continuous integration server (we don't want to have commits blocked for months because the CI server is down).
-
Write the appropriate
.clang-format
file. For this, if ever the existing options are not enough, we should be able to contribute upstream for new options. We could fit into the requirements (at least the first right now: a project of significant size): http://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options -
Set up our CI to fix syntax on new commits.
Obviously this is a long term feature request since I doubt we will see this happen soon. But let's leave this open for now.
Version: git master