[PATCH] Fix trailing whitespace in new (!!!) code

Andrew Bartlett abartlet at samba.org
Fri Apr 6 19:30:40 UTC 2018


On Fri, 2018-04-06 at 13:54 +0200, Ralph Böhme via samba-technical
wrote:
> On Fri, Apr 06, 2018 at 01:48:34PM +0200, Volker Lendecke via samba-technical wrote:
> > Attached find a patch that cleans up fresh code to match
> > README.Coding. Gary, if you review Andrew's code in the future, can
> > you please point him at the relevant section of README.Coding, quoted
> > here for your convenience?
> 
> I messed this up many times as well, the only thing that helped me to avoid
> this error was to configure my editor to highlight trailing whitespace. :)

I think it would be easier and far more productive to fix
README.Coding.  This rule causes way to much trouble, it would be far
more productive if the time spent enforcing it was spent on actual code
review, as the rationale is, in my view, entirely weak.

(Unlike the 80 column rule, which is to do with code nesting and
complexity, trailing white-space has zero impact on the code when
'cleaned up'). 

Finally, before someone suggests to 'just' have git clean it up, there
are times (our XML docs, LDIF files) where it is significant, so it
can't 'just' be stripped.

We do need focus on code style and quality in reviews, but while Jeremy
will again say something about M&Ms here, we have got to the point were
everybody looks for the M&Ms and never the rest of the code. 

Indeed Gary has got to the point where he jokes in the office that he
should put in a long line in the hope of attracting some comment!

Please review and push! 

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
-------------- next part --------------
From 15dfff03f20643f168b26afa0898e6455f145d5b Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Sat, 7 Apr 2018 07:22:13 +1200
Subject: [PATCH] README.Coding: Trim rules to things that actually impact on
 Samba

Some rules cause cause folks to flag code only for whitespace issues
rather than for the code found within.

Focus our rules on things that matter, so as to increase team harmony
and decrease pointless code churn.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
---
 README.Coding | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/README.Coding b/README.Coding
index e89925cad26..2f243d8def6 100644
--- a/README.Coding
+++ b/README.Coding
@@ -36,11 +36,6 @@ are the highlights.
   to check your changes.
 
 * Use 8 Space Tabs to Indent
-  No whitespace fillers.
-
-* No Trailing Whitespace
-  Use source3/script/strip_trail_ws.pl to clean up your files before
-  committing.
 
 * Follow the K&R guidelines.  We won't go through all of them here. Do you
   have a copy of "The C Programming Language" anyways right? You can also use
@@ -73,18 +68,7 @@ following to $HOME/.exrc:
   set shiftwidth=8
 
 For Vim, the following settings in $HOME/.vimrc will also deal with
-displaying trailing whitespace:
-
-  if has("syntax") && (&t_Co > 2 || has("gui_running"))
-	syntax on
-	function! ActivateInvisibleCharIndicator()
-		syntax match TrailingSpace "[ \t]\+$" display containedin=ALL
-		highlight TrailingSpace ctermbg=Red
-	endf
-	autocmd BufNewFile,BufRead * call ActivateInvisibleCharIndicator()
-  endif
-  " Show tabs, trailing whitespace, and continued lines visually
-  set list listchars=tab:»·,trail:·,extends:…
+displaying long lines:
 
   " highlight overly long lines same as TODOs.
   set textwidth=80
-- 
2.14.3



More information about the samba-technical mailing list