From 0cc1f2382629a9b41ad3a0a8e8b869649a7d77d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Wed, 21 Mar 2018 23:10:35 +0100 Subject: [PATCH] Add --keep-one-line-blocks to astyle --- CONTRIBUTING.md | 2 +- src/Cutter.astylerc | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e7678a0..5ea13817 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,7 +39,7 @@ We follow [these guidelines](https://wiki.qt.io/Qt_Coding_Style) to format the c If in doubt, you can use [AStyle 2.06](https://sourceforge.net/projects/astyle/files/astyle/astyle%202.06/) to format the code. The command line for formatting the code according to the style is: ```bash -astyle --style=kr --indent=spaces=4 --align-pointer=name --align-reference=name --convert-tabs --attach-namespaces --max-code-length=100 --max-instatement-indent=120 --pad-header --pad-oper filename.cpp +astyle --project=src/Cutter.astylerc src/filename.cpp ``` ### Functions documentation diff --git a/src/Cutter.astylerc b/src/Cutter.astylerc index f5444420..24a06fd7 100644 --- a/src/Cutter.astylerc +++ b/src/Cutter.astylerc @@ -1,13 +1,12 @@ ---style=allman ---convert-tabs +--style=kr +--indent=spaces=4 --align-pointer=name --align-reference=name ---indent=spaces ---indent-namespaces ---indent-col1-comments ---pad-oper +--convert-tabs +--attach-namespaces +--max-code-length=100 +--max-instatement-indent=120 --pad-header ---unpad-paren +--pad-oper --keep-one-line-blocks ---close-templates