]> git.ipfire.org Git - thirdparty/bind9.git/commit
revise .clang-format and add a C formatting script in util
authorEvan Hunt <each@isc.org>
Thu, 13 Feb 2020 18:16:25 +0000 (10:16 -0800)
committerEvan Hunt <each@isc.org>
Thu, 13 Feb 2020 23:04:36 +0000 (15:04 -0800)
commit0255a974734bf1b4388f68dd6b3940b31f778f3b
tree8579f4cba3e15f62ef9e30e70deafe6dfde7f880
parent67b68e06ad6f3799872cd79de999276df1e1e872
revise .clang-format and add a C formatting script in util

- add util/cformat.sh, which runs clang-format on all C files with
  the default .clang-format, and on all header files with a slightly
  modified version.
- use correct bracing after multi-line control statements
- stop aligning variable declarations to avoid problems with pointer
  alignment, but retain aligned declarations in header files so that
  struct definitions look cleaner.
- static function prototypes in C files can skip the line break after
  the return type, but function prototypes in header files still have
  the line break.
- don't break-before-brace in function definitions. ISC style calls
  for braces on the same line when function parameters fit on a single
  line, and a line break if they don't, but clang-format doesn't yet
  support that distinction. one-line function definitions are about
  four times more common than multi-line, so let's use the option that
  deviates less.
.clang-format
util/cformat.sh [new file with mode: 0644]
util/copyrights