public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Guoheyi <guoheyi@huawei.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: How to auto format source file to be EDK2 code style?
Date: Thu, 23 Mar 2017 02:06:03 +0000	[thread overview]
Message-ID: <B328F08581D714418202ABF306D3781C3AC0A799@DGGEMA505-MBS.china.huawei.com> (raw)

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 "astyle" almost meets edk2 code style with certain settings, except it will remove the indent before closing parenthesis ")" in a new line. E.g. it will change 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=1tbs
--indent=spaces=2
--min-conditional-indent=1
--max-instatement-indent=40
--align-pointer=name
--align-reference=name
--max-code-length=80

Thanks and regards,

Gary (Heyi Guo)



             reply	other threads:[~2017-03-23  2:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  2:06 Guoheyi [this message]
2017-03-23  3:26 ` How to auto format source file to be EDK2 code style? Kinney, Michael D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B328F08581D714418202ABF306D3781C3AC0A799@DGGEMA505-MBS.china.huawei.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox