Hi, The knfmt[1] utility formats source code files to conform to the Kernel Normal Form (KNF) in a best effort fashion. It's not a silver bullet but is able to get the rudimentary formatting right.
By default, source code is read from standard input and the formatted source code is written to standard output: $ knfmt <knfmt.c It can perform an in place edit by writing back the formatted source code: $ knfmt -i knfmt.c It can produce a diff between the original and formatted source code: $ knfmt -d knfmt.c In addition, it can given a diff only format the changed lines, handy while working on existing code. This option is compatible with the options mentioned above: $ cvs -q diff | knfmt -Dd $ git diff | knfmt -Dd I'm not encouraging anyone to start reformatting code in our tree and sending out diffs. Using the -D option during development is hopefully more useful. OK to import? (I'm the author) [1] https://github.com/mptre/knfmt
knfmt.tgz
Description: application/tar-gz