From fdaf82f96b96aaa4504c2d007befdce5a83ee8c6 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 29 Jan 2020 10:23:08 -0800 Subject: [PATCH] Link .clang-format file to system/core one. Use the .clang-format-2 found in system/core instead of this which is not actually being used. Also, enable clang-format running by default. All upstream directories are marked as ignoring formatting so that their source files are not modified. Test: NA Change-Id: Icee6030f373fa5f072df162f97e6f34320e3d89a --- .clang-format | 16 +--------------- PREUPLOAD.cfg | 6 ++++++ libc/kernel/.clang-format | 1 + libc/upstream-freebsd/.clang-format | 1 + libc/upstream-netbsd/.clang-format | 1 + libc/upstream-openbsd/.clang-format | 1 + libm/upstream-freebsd/.clang-format | 1 + libm/upstream-netbsd/.clang-format | 1 + 8 files changed, 13 insertions(+), 15 deletions(-) mode change 100644 => 120000 .clang-format create mode 100644 libc/kernel/.clang-format create mode 100644 libc/upstream-freebsd/.clang-format create mode 100644 libc/upstream-netbsd/.clang-format create mode 100644 libc/upstream-openbsd/.clang-format create mode 100644 libm/upstream-freebsd/.clang-format create mode 100644 libm/upstream-netbsd/.clang-format diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 7630d1626..000000000 --- a/.clang-format +++ /dev/null @@ -1,15 +0,0 @@ -BasedOnStyle: Google -AllowShortBlocksOnASingleLine: false -AllowShortFunctionsOnASingleLine: false - -ColumnLimit: 100 -CommentPragmas: NOLINT:.* -DerivePointerAlignment: false -IndentWidth: 2 -PointerAlignment: Left -TabWidth: 2 -UseTab: Never -PenaltyExcessCharacter: 32 - -Cpp11BracedListStyle: false -IncludeBlocks: Preserve \ No newline at end of file diff --git a/.clang-format b/.clang-format new file mode 120000 index 000000000..4cefd6583 --- /dev/null +++ b/.clang-format @@ -0,0 +1 @@ +../system/core/.clang-format-2 \ No newline at end of file diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index 7b533a472..11d9fe624 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -1,2 +1,8 @@ [Hook Scripts] notice = tools/update_notice.sh + +[Builtin Hooks] +clang_format = true + +[Builtin Hooks Options] +clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp diff --git a/libc/kernel/.clang-format b/libc/kernel/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libc/kernel/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/libc/upstream-freebsd/.clang-format b/libc/upstream-freebsd/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libc/upstream-freebsd/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/libc/upstream-netbsd/.clang-format b/libc/upstream-netbsd/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libc/upstream-netbsd/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/libc/upstream-openbsd/.clang-format b/libc/upstream-openbsd/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libc/upstream-openbsd/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/libm/upstream-freebsd/.clang-format b/libm/upstream-freebsd/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libm/upstream-freebsd/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/libm/upstream-netbsd/.clang-format b/libm/upstream-netbsd/.clang-format new file mode 100644 index 000000000..e3845288a --- /dev/null +++ b/libm/upstream-netbsd/.clang-format @@ -0,0 +1 @@ +DisableFormat: true