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

Ralph Böhme slow at samba.org
Tue Apr 10 10:44:31 UTC 2018


Hi metze,

On Tue, Apr 10, 2018 at 09:53:11AM +0200, Stefan Metzmacher wrote:
> Am 10.04.2018 um 09:31 schrieb Swen Schillig via samba-technical:
> > I really like Douglas' work as well, especially the part where
> > the pre-commit hook gets installed auto-magically if there isn't one.
> > 
> > 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.

well, the problem that caused the whole discussion was trailing whitespace, so
maybe we should, at least for now, just fix the problem at hand and defer
more sophisticated stuff for later. I don't think there will be quick consensus
on such a tool that correctly checks for everything in README.Coding and then
there's also stuff in README.Coding that is dubious like formatting in for
loops: we seem to expect

	i = 0;
	
	if (i < 10) {
		i += 1;
	}

but deem

	for (i=0; i<10; i+=1)

acceptable.

I guess there will be more cases like this.

Fwiw, you have seen this parallel thread:
https://lists.samba.org/archive/samba-technical/2018-April/126906.html

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG Key Fingerprint:           FAE2 C608 8A24 2520 51C5
                               59E4 AA1E 9B71 2639 9E46



More information about the samba-technical mailing list