You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/11/07 22:15:34 UTC
mesos git commit: Introduced `.clang-tidy` configuration file.
Repository: mesos
Updated Branches:
refs/heads/master 76fcf0e6d -> 82b040a60
Introduced `.clang-tidy` configuration file.
Review: https://reviews.apache.org/r/63649
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/82b040a6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/82b040a6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/82b040a6
Branch: refs/heads/master
Commit: 82b040a60561cf94dec3197ea88ae15e57bcaa97
Parents: 76fcf0e
Author: Michael Park <mp...@apache.org>
Authored: Tue Nov 7 02:30:51 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Nov 7 14:15:13 2017 -0800
----------------------------------------------------------------------
bootstrap | 4 ++++
support/clang-tidy | 31 +++++++++++++++++++++++++++++++
support/gitignore | 1 +
support/mesos-tidy.sh | 33 ---------------------------------
support/mesos-tidy/entrypoint.sh | 3 +++
5 files changed, 39 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/82b040a6/bootstrap
----------------------------------------------------------------------
diff --git a/bootstrap b/bootstrap
index d0dd491..7be2cc9 100755
--- a/bootstrap
+++ b/bootstrap
@@ -76,6 +76,10 @@ if test ! -e .clang-format; then
ln -s support/clang-format .clang-format
fi
+if test ! -e .clang-tidy; then
+ ln -s support/clang-tidy .clang-tidy
+fi
+
if [ -n "$AUTOMAKE" ] || [ -n "$ACLOCAL" ] ; then
if [ -z "$ACLOCAL" ] || [ -z "$AUTOMAKE" ] ; then
_present="AUTOMAKE"
http://git-wip-us.apache.org/repos/asf/mesos/blob/82b040a6/support/clang-tidy
----------------------------------------------------------------------
diff --git a/support/clang-tidy b/support/clang-tidy
new file mode 100644
index 0000000..47a2cad
--- /dev/null
+++ b/support/clang-tidy
@@ -0,0 +1,31 @@
+---
+Checks:
+"\
+clang-diagnostic-*,\
+clang-analyzer-*,\
+-clang-analyzer-,\
+-clang-analyzer-core.CallAndMessage,\
+-clang-analyzer-core.NonNullParamChecker,\
+-clang-analyzer-core.NullDereference,\
+-clang-analyzer-cplusplus.NewDelete,\
+-clang-analyzer-cplusplus.NewDeleteLeaks,\
+-clang-analyzer-optin.cplusplus.VirtualCall,\
+\
+google-*,\
+-google-build-using-namespace,\
+-google-default-arguments,\
+-google-explicit-constructor,\
+-google-global-names-in-headers,\
+-google-readability-namespace-comments,\
+-google-runtime-int,\
+-google-runtime-member-string-references,\
+-google-readability-casting,\
+-google-runtime-references,\
+\
+mesos-*,\
+-mesos-this-capture,\
+\
+readability-redundant-string-cstr\
+"
+FormatStyle: file
+...
http://git-wip-us.apache.org/repos/asf/mesos/blob/82b040a6/support/gitignore
----------------------------------------------------------------------
diff --git a/support/gitignore b/support/gitignore
index 90b6697..7218eda 100644
--- a/support/gitignore
+++ b/support/gitignore
@@ -3,6 +3,7 @@
# Files created by ./bootstrap.
.clang-format
+.clang-tidy
.reviewboardrc
Makefile.in
aclocal.m4
http://git-wip-us.apache.org/repos/asf/mesos/blob/82b040a6/support/mesos-tidy.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy.sh b/support/mesos-tidy.sh
index c33dfe0..b7e75f0 100755
--- a/support/mesos-tidy.sh
+++ b/support/mesos-tidy.sh
@@ -21,39 +21,6 @@ set -o pipefail
MESOS_DIR=$(git rev-parse --show-toplevel)
-DEFAULT_CHECKS=
-
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'clang-diagnostic-*'
-
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'clang-analyzer-*'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.CallAndMessage'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.NonNullParamChecker'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-core.NullDereference'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-cplusplus.NewDelete'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-clang-analyzer-optin.cplusplus.VirtualCall'
-
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'google-*'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-build-using-namespace'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-default-arguments'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-explicit-constructor'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-global-names-in-headers'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-readability-namespace-comments'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-int'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-member-string-references'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-readability-casting'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-google-runtime-references'
-
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'mesos-*'
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'-mesos-this-capture'
-
-DEFAULT_CHECKS=${DEFAULT_CHECKS},'readability-redundant-string-cstr'
-
-# Configure how checks are run. These variables can be overridden by setting the
-# respective environment variables before invoking this script.
-# TODO(bbannier): Enable more upstream checks by default, e.g., from the Google set.
-CHECKS=${CHECKS:-${DEFAULT_CHECKS}}
-
# Check for unstaged or uncommitted changes.
if ! $(git diff-index --quiet HEAD --); then
echo 'Please commit or stash any changes before running `mesos-tidy`.'
http://git-wip-us.apache.org/repos/asf/mesos/blob/82b040a6/support/mesos-tidy/entrypoint.sh
----------------------------------------------------------------------
diff --git a/support/mesos-tidy/entrypoint.sh b/support/mesos-tidy/entrypoint.sh
index bdaa453..dbea146 100755
--- a/support/mesos-tidy/entrypoint.sh
+++ b/support/mesos-tidy/entrypoint.sh
@@ -24,6 +24,9 @@ SRCDIR=/tmp/SRC
# Prepare sources
git clone --depth 1 file:///SRC "${SRCDIR}"
+# We require this in order to populate the `.clang-tidy` file at the top-level.
+(cd "${SRCDIR}" && ./bootstrap)
+
# Configure sources
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \