From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dggrg02-dlp.huawei.com (unknown [45.249.212.188]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D72388042A for ; Wed, 22 Mar 2017 19:06:13 -0700 (PDT) Received: from 172.30.72.55 (EHLO DGGEMA403-HUB.china.huawei.com) ([172.30.72.55]) by dggrg02-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AKI60970; Thu, 23 Mar 2017 10:06:06 +0800 (CST) Received: from DGGEMA505-MBS.china.huawei.com ([169.254.4.120]) by DGGEMA403-HUB.china.huawei.com ([10.3.20.44]) with mapi id 14.03.0301.000; Thu, 23 Mar 2017 10:06:04 +0800 From: Guoheyi To: "edk2-devel@lists.01.org" Thread-Topic: [edk2] How to auto format source file to be EDK2 code style? Thread-Index: AdKjegX06CJvetc8SPeGfbozMaLLNQ== Date: Thu, 23 Mar 2017 02:06:03 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.31.55] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.58D32D8F.0034, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=169.254.4.120, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8ecbead52f055d87f02b70370f4941dc X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: How to auto format source file to be EDK2 code style? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 02:10:42 -0000 Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi folks, A number of our existing source code files are in really bad format and I'm= trying to find a quick way to re-style them. I found the tool called "asty= le" almost meets edk2 code style with certain settings, except it will remo= ve the indent before closing parenthesis ")" in a new line. E.g. it will ch= ange code like below: @@ -116,7 +116,7 @@ EhciPciIoPollIo ( IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result - ) +) Any suggestion? And this is my "astyle" configuration: #--indent-switches --indent-cases --indent-namespaces --indent-preprocessor --indent-col1-comments --pad-oper --pad-header --add-brackets #--pad-comma --convert-tabs --indent-classes --style=3D1tbs --indent=3Dspaces=3D2 --min-conditional-indent=3D1 --max-instatement-indent=3D40 --align-pointer=3Dname --align-reference=3Dname --max-code-length=3D80 Thanks and regards, Gary (Heyi Guo)