aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-09-18 15:32:25 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-09-18 13:32:25 +0000
commitba7c8cb5715a162ac41ca5241628e7e02ecd217f (patch)
tree41687c822ea825dcc079e7f471d9ec806d311374 /contrib
parent5fdd6038147e4ba30c8c01332dae8ab0d717bc14 (diff)
downloadgcc-ba7c8cb5715a162ac41ca5241628e7e02ecd217f.zip
gcc-ba7c8cb5715a162ac41ca5241628e7e02ecd217f.tar.gz
gcc-ba7c8cb5715a162ac41ca5241628e7e02ecd217f.tar.bz2
Tweak clang-format configuration.
2019-09-18 Martin Liska <mliska@suse.cz> * clang-format: Tweak configuration based on new options offered. From-SVN: r275875
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog5
-rw-r--r--contrib/clang-format20
2 files changed, 21 insertions, 4 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 0e473d6..5f62e8b 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-18 Martin Liska <mliska@suse.cz>
+
+ * clang-format: Tweak configuration based on new
+ options offered.
+
2019-09-09 Jose E. Marchesi <jemarch@gnu.org>
* config-list.mk (LIST): Disable go in bpf-*-* targets.
diff --git a/contrib/clang-format b/contrib/clang-format
index d734001..7a4e96f 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 <http://www.gnu.org/licenses/>.
-# 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