From patchwork Wed Sep 18 13:30:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1163973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-509216-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mBFOWT26"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46YLTn4Srzz9sNw for ; Wed, 18 Sep 2019 23:31:07 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=aj5jzOBN+9feyMfJZCmZK5aoMo13bXPeKvNdT6V4P37D345+lj JTVw0V2df+45EexFYeh8Y4qLNekD9jSIsX9FoN+u2zIRT2t/FRLmKodRr6WbIbQU 3YMVpbk2nu4AdmXmdvXPdlWY//VdHrqoDKA5J2msJNby22AzfhBpYCNs0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=8bh465d9xijX853SXE0yEWMDJm0=; b=mBFOWT26dPYlkl9IcYlc HGDAuqg/tTYLSg6E96i+SmoYE+52gVIDaiw7I0IQQYLiKz86WuPsJufJkbf2Otjz rszQYZKEycKhDCZrW8JT004xo7LeOMp4Q5G4UM5TwlaeCirDdJr01N3B65LayF6c xTVGwmi5S+txoD1Z2cJne9o= Received: (qmail 45275 invoked by alias); 18 Sep 2019 13:31:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 45267 invoked by uid 89); 18 Sep 2019 13:31:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_PASS autolearn=ham version=3.3.1 spammy=downloaded, packaged, touched, HX-Languages-Length:2036 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2019 13:30:59 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B67F3B621; Wed, 18 Sep 2019 13:30:56 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Tweak clang-format configuration. To: gcc-patches@gcc.gnu.org Cc: Jeff Law Message-ID: <8c78f78c-19b7-995f-fee9-5f475f1bede3@suse.cz> Date: Wed, 18 Sep 2019 15:30:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. I'm going to install a patch to clang-format that tweaks configuration. I'm planning to use it on daily basis and I'm planning to send an analysis later on. Martin contrib/ChangeLog: 2019-09-18 Martin Liska * clang-format: Tweak configuration based on new options offered. --- contrib/clang-format | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/clang-format b/contrib/clang-format index d734001c06f..7a4e96f64ca 100644 --- a/contrib/clang-format +++ b/contrib/clang-format @@ -13,16 +13,21 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# clang-format 3.8+ (Mon Nov 16) is required +# clang-format 7.0.1 is required # # To utilize the tool to lines just touched by a patch, use -# clang-format-diff.py script, which can be downloaded here: -# https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py +# clang-format-diff script that is usually also packaged with clang-format. +# +# Example of usage: +# git diff -U0 --no-color | clang-format-diff -p1 +# (here the tool will generate a patch) +# git diff -U0 --no-color | clang-format-diff -p1 -i +# (modifications are applied) --- Language: Cpp AccessModifierOffset: -2 -AlwaysBreakAfterDefinitionReturnType: All +AlwaysBreakAfterReturnType: TopLevel BinPackArguments: true BinPackParameters: true BraceWrapping: @@ -37,6 +42,7 @@ BraceWrapping: BeforeCatch: true BeforeElse: true IndentBraces: true + SplitEmptyFunction: false BreakBeforeBinaryOperators: All BreakBeforeBraces: Custom BreakBeforeTernaryOperators: true @@ -136,3 +142,9 @@ SpaceAfterCStyleCast: true SpaceBeforeParens: Always SpacesBeforeTrailingComments: 1 UseTab: Always +AlignEscapedNewlines: Right +AlignTrailingComments: true +AllowShortFunctionsOnASingleLine: All +AlwaysBreakTemplateDeclarations: MultiLine +KeepEmptyLinesAtTheStartOfBlocks: false +Standard: Cpp03