[PATCH] Add utilities to check style

Ralph Böhme slow at samba.org
Sun May 20 19:18:50 UTC 2018


On Mon, May 07, 2018 at 03:47:18PM +0200, Ralph Böhme wrote:
> On Mon, May 07, 2018 at 08:11:43AM -0400, Simo wrote:
> > On Sun, 2018-05-06 at 21:54 +0200, Ralph Böhme wrote:
> > > On Sun, May 06, 2018 at 01:22:05PM -0400, Simo wrote:
> > > > I fetched this branch but there is
> > > > no 54f124f39bc5ae316faab97e2ee2d00c3b8cfe44
> > > > 
> > > > so I can't test it.
> > > 
> > > hm, maybe I forgot to push the snapshot of the branch. The branch "tmp" now
> > > points at commit 54f124f39bc5ae316faab97e2ee2d00c3b8cfe44.
> > 
> > Thanks,
> > If my coffee is strong enough this morning :-) I think the error is
> > here: "Jean Fran\xe7ois Micouleau"
> >
> > It think this has been copied over and over since back then when code
> > pages were used instead of utf8.
> > 
> > There are 6 files in the tree with invalid utf8 characters in Jean
> > François name. A patch is attached to fix that.
> > 
> > Please RB+ and push this patch, first win for the style checker,
> > although it found an encoding issue rather than a style one :-)
> 
> :)
> 
> Pushed. Thanks!
> 
> I'll retest my WIP branches with the style checker one this fix is in master.

looks really nice. Spotted lots of README.Coding issues in my largish WIP
branches, really helpful.

One thing remains: the lack of a README.Coding paragraph specifying how to
nicely uncuddle if conditions spanning more then one line and a corresponding
check in the script. I'd call this sanitized Allman-8.

It seems unlikely that we'll reach consensus in this case anytime soon, so I'm
fine with just dropping the script with the cuddle check removed.

So, with the attached fixup: RB+.

-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
-------------- next part --------------
From dc0c92306006efe0b908dd8b5761437cafa993d2 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Sun, 13 May 2018 15:17:15 +0200
Subject: [PATCH] FIXUP: cstyle-file.py

---
 script/cstyle-file.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/script/cstyle-file.py b/script/cstyle-file.py
index 7a7f25cc18d..e5ef0041a39 100755
--- a/script/cstyle-file.py
+++ b/script/cstyle-file.py
@@ -135,8 +135,6 @@ import subprocess
 def check_braces(line, ln):
     # Strip out one-line initializer expressions.
     line = re.sub(r'=\s*{.*}', '', line)
-    if line.lstrip().startswith('{') and not line.startswith('{'):
-        warn(ln, 'Un-cuddled open brace')
     if re.search(r'{\s*\S', line):
         warn(ln, 'Code on line after open brace')
     if re.search(r'\S.*}', line):
-- 
2.13.6



More information about the samba-technical mailing list