[Dnsmasq-discuss] clang format

Geert Stappers stappers at stappers.nl
Sun Oct 13 17:05:39 BST 2019


On Sat, Oct 12, 2019 at 11:56:58PM +0100, Simon Kelley wrote:
> On 10/10/2019 22:00, Geert Stappers wrote:
> > Previous-Subject: Re: [Dnsmasq-discuss] [patch] empty empty lines
> > In-Reply-To: <55adb604-91a9-77a8-ed41-500363f4cbb2 at mail.com>
> > On Mon, Sep 30, 2019 at 07:18:12PM +0200, john doe wrote:
> >> On 9/30/2019 4:50 PM, Simon Kelley wrote:
> >>>
> >>>  ...
> >>>
> >>> So, let's come to a consensus if a one-time clean up commit across the
> >>> codebase is a price worth paying to fix the formatting issues, and if it
> >>> is, work out how to add automatic filters to git to keep things clean
> >>> afterwards. If anyone has experience of that, I'd like to hear.
> >>>
> >>
> >> The way I see things which is up for debate:
> >> - Everyone that is committing to the project would need to use ....
> > 
> > Where it is OK to get tooling to bend our source code in shape,
> > is it more important to decide in which shape it should be bend.
> > 
> >  ... Linux kernel (C language, several contributors)
> >  have code style documented and have machine reable version ...
> >  
> > Tooling they use is `clangformat`
> >  https://clang.llvm.org/docs/ClangFormat.html
> > 
> > 
> > Please take the above information as input for moving Dnsmasq from
> > a project without a coding style to a project with a coding style.
> > 
> 
> 
> This seems to have escalated from inconsistent use of spaces and tabs to
> "without a coding style". For information, the C coding style in dnsmasq
> is the GNU style, except without the space preceding (
> 
> I like that style, I chose that style and it's not going to change.
> 

Having that choice machine readable in the Dnsmasq source tree
is what I'm aiming for.

Manual page of clang-format (version 8.0.1) says

        -style=<string>           - Coding style, currently supports:
	              LLVM, Google, Chromium, Mozilla, WebKit.

I don't know which one is closest to the GNU style. A websearch
on "clang format gnu style" did yield a mailinglist posting
 https://gcc.gnu.org/ml/gcc-patches/2015-11/msg02214.html
It starts with
 Following patch adds a clang-format config file that should respect the
 GNU coding standards.

Recent version is https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=contrib/clang-format



Groeten
Geert Stappers
-- 
Leven en laten leven



More information about the Dnsmasq-discuss mailing list