[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Whitespace fixes



Hi Florian,

On Wed, Oct 31, 2012 at 05:42:48PM +0100, Florian Bruhin wrote:
> Subject: [PATCH] Whitespace fixes
> 
> - Change tabs to four spaces in herbstcommander.sh
> - Remove whitespace at the end of a line
> - Try to get whitespaces for #include/#define's consistent
> - Try to get whitespace between functions consistent
>   (always 1 blank line instead of 0/1/2)

I like these fixups except that one:

> - Remove empty lines from beginning/end of files

I'd like to have a empty line at the end of files. E.g. It looks strange
in the NEWS file if the file is ends directly after the last bullet
point.

I also like it for header and c-source files to make it clear there is a
newline at the end of file (which is required by some compilers). So I
want to insist on the empty line of each file (even if it is more than
just "a newline at the end of file"), especially because it really
doesn't harm.

So please adjust your script or do something like:

sed -i '$s/^\(..*\)$/\1\n\n/' $(git ls-files)

Be aware: that sed-command is not totally correct, because it adds empty
lines e.g. in HACKING after the vim mode line.

Thorsten