Simo via samba-technical
2018-04-08 17:02:10 UTC
Hi all,
given recent discussions I finally took some time to do what I wanted
to do for a long time.
This utilities, which I've simply stolen and adapted from MIT krb5, can
be used in commit hooks or individually to check for style issues in
commits or files.
I do not know if putting them under python/ is right, you (reviewer)
tell me.
Run:
$ python ./python/cstyle.py
Your latest commit or your current uncommitted code is checked.
Pass in a revision or a revision range and specific commits can be
checked at once:
Example:
$ python ./python/cstyle.py HEAD~10..HEAD
The style violations are output per file with the line and kind of
violation.
You can style check a whole file this way:
$ python ./python/cstyle-file.py $FILENAME
Or:
$ cat $FILENAME | python ./python/cstyle-file.py
Try to check the last 100 commits for an idea of what violations are
found.
HTH,
Simo.
given recent discussions I finally took some time to do what I wanted
to do for a long time.
This utilities, which I've simply stolen and adapted from MIT krb5, can
be used in commit hooks or individually to check for style issues in
commits or files.
I do not know if putting them under python/ is right, you (reviewer)
tell me.
Run:
$ python ./python/cstyle.py
Your latest commit or your current uncommitted code is checked.
Pass in a revision or a revision range and specific commits can be
checked at once:
Example:
$ python ./python/cstyle.py HEAD~10..HEAD
The style violations are output per file with the line and kind of
violation.
You can style check a whole file this way:
$ python ./python/cstyle-file.py $FILENAME
Or:
$ cat $FILENAME | python ./python/cstyle-file.py
Try to check the last 100 commits for an idea of what violations are
found.
HTH,
Simo.