[PATCH for comments] configure: install a whitespace checking pre-commit hook for developers

Stefan Metzmacher metze at samba.org
Tue Apr 10 09:58:18 UTC 2018


Am 10.04.2018 um 11:51 schrieb Douglas Bagnall:
> On 10/04/18 19:53, Stefan Metzmacher wrote:
>> Am 10.04.2018 um 09:31 schrieb Swen Schillig via samba-technical:
>>> But, is trailing white-spaces all we want to check for ?
>>> Why not go a bit further and have a few more of those "annoying"
>>> violations flagged as well ?
>>>
>>> Like 
>>> 	- leading white-space
>>> 	- code indent should use tabs where possible
>>> 	- space required before the open parenthesis '('
>>> 	- line over 80 characters
>>> 	- Missing a blank line after declarations
>>> 	- space prohibited before that close parenthesis ')'
>>> 	- ...
>>>
>>> especially if all those checks can be turned off, if required for
>>> whatever reason, with a simple "git --no-check ...."
>>
>> I was also wondering about that.
>>
>> I think we should use some like wireshark,
>> were the real script[s] are part of the checkout and the pre-commit hook
>> is just a wrapper arround it, that way we can improve the script step by
>> step.
>>
>> See
>> https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=tools/pre-commit
>>
> 
> Yes.
> 
> Of course, a difficulty we have that wireshark and other projects
> don't is 17655 lines of C with trailing whitespace and nearly 50k
> lines over 80 characters, which we don't want to change all at once. I
> think the wireshark scripts check the whole of the affected file on
> the assumption that everything you didn't change will still be
> perfectly formatted. Our scripts will have to fiddle around with
> diffs.

I'm not proposing to use the wireshark scripts, I haven't looked at them
in details.

The logic for using a script that is part of the checkout and having a
.git/hook/pre-commit script that just calls into the working tree
is what I'd like to have (and maybe the logic to detect an outdated script)

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180410/5bb40b46/signature.sig>


More information about the samba-technical mailing list