[dpdk-dev] [PATCH] fix trailing whitespace.

Neil Horman nhorman at tuxdriver.com
Wed Jun 11 17:46:04 CEST 2014


On Wed, Jun 11, 2014 at 03:24:04PM +0000, Richardson, Bruce wrote:
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> > Sent: Wednesday, June 11, 2014 3:04 AM
> > To: Richardson, Bruce
> > Cc: dev at dpdk.org; Neil Horman
> > Subject: Re: [dpdk-dev] [PATCH] fix trailing whitespace.
> > 
> > > > This commit removes trailing whitespace from lines in files. Almost all
> > > > files are affected, as the BSD license copyright header had trailing
> > > > whitespace on 4 lines in it [hence the number of files reporting 8 lines
> > > > changed in the diffstat].
> > > >
> > > > Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> > > Acked-by: Neil Horman <nhorman at tuxdriver.com>
> > 
> > I've completed it with these changes:
> > 	- remove spaces before tabs in libs
> > 	- remove more trailing spaces in non-C files
> > 
> > Applied for version 1.7.0.
> > 
> > Some whitespaces and indentation errors are remaining, especially in examples.
> > But it can be fixed when examples will be updated.
> > I'm not a big fan of such patch. I prefer to take care of not adding new
> > spacing errors. So from now, trailing whitespaces, spaces before tabs
> > and wrong indentation should be tracked carefully in new patches.
> > 
> Just FYI: my reasoning for cleaning it up now is that it allows us to write rules for our editors or IDEs to automatically fix whitespace errors on save (the patch I generated was created by using a vim rule on file save). Without having things cleaned up ahead of time, having a vim rule such as this will cleanup each file as it is modified, leading to lots of extra whitespace changes in our diffs, which are irrelevant to the code being changed. This then makes our lives harder when working on patches.
> 

This sort of change should probably be accompanied by a script to do patch
checking prior to submission (something like checkpatch.pl in the linux kernel).
Not every contributor will have a whitespace cleaning rule set, and such a
checker will be allow users to clean patches prior to submission, both for
whitepace errors and any other errors you want to enforce (trailing whtespace,
leading spaces, parenthetical spaces, etc).

Neil

> /Bruce
> 


More information about the dev mailing list