[Parted-edge] [PATCH] Create the needed infra-structure to enforce the coding style
Anant Narayanan
anant at kix.in
Mon Oct 22 12:20:21 UTC 2007
Hi all,
Just to a get a feel of what the code looks like in both the styles,
I've created two git repositories:
http://git.debian.org/?p=users/anant-guest/parted-bindings-alternate.git;a=summary
and
http://git.debian.org/?p=users/anant-guest/parted-bindings-gcs.git;a=summary
The first repository enforces the coding style as proposed by Otavio,
and the other enforces the GNU Coding Standards.
Put this in your .git/hooks/pre-commit and make it executable:
> #!/bin/sh
>
> git-diff-files | awk '/\.(cc|h)$/{print $6}' > uncrustified
> uncrustify --no-backup -c uncrustify.cfg -F uncrustified
> if [ "$?" -ne "0" ]; then
> rm uncrustified
> echo "Source formatting failed, check if uncrustify is in your PATH environment variable"
> exit 1
> else
> rm uncrustified
> exit 0
> fi
I did put it on the repository on Alioth, but apparently that doesn't
get passed on when you do a git-clone.
Once we're decided on a style, we can enforce it on the main
parted-bindings repository.
Cheers,
--
Anant
P.S. The bug tracker / wiki (parted.alioth.debian.org) is fully
functional now and (mostly) spam-free. Thanks to Otavio for bringing the
issues to notice.
More information about the Parted-edge
mailing list