You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2017/08/31 23:51:23 UTC

kudu git commit: Add "make tidy" target

Repository: kudu
Updated Branches:
  refs/heads/master 463d59ce7 -> 1cfdf36fc


Add "make tidy" target

This adds a simple cmake target to run a local clang-tidy check, instead
of having to come up with the incantation to run the tidy script.

Change-Id: I77ab0376042b7ac754a24ebc7e18bcd6dc240011
Reviewed-on: http://gerrit.cloudera.org:8080/7917
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/1cfdf36f
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/1cfdf36f
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/1cfdf36f

Branch: refs/heads/master
Commit: 1cfdf36fcbaf72102f04c0a0e009cfd6a1d1ec68
Parents: 463d59c
Author: Mike Percy <mp...@apache.org>
Authored: Thu Aug 31 01:20:09 2017 -0700
Committer: Mike Percy <mp...@apache.org>
Committed: Thu Aug 31 23:50:59 2017 +0000

----------------------------------------------------------------------
 CMakeLists.txt |  8 ++++++++
 README.adoc    | 13 +++++++++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/1cfdf36f/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6614987..5814a10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1111,6 +1111,14 @@ if (UNIX)
 endif (UNIX)
 
 ############################################################
+# "make tidy" target
+############################################################
+if (UNIX)
+  add_custom_target(tidy ${BUILD_SUPPORT_DIR}/clang_tidy_gerrit.py -n HEAD)
+  add_dependencies(tidy pb-gen krpc-gen)
+endif (UNIX)
+
+############################################################
 # "make docs" target
 ############################################################
 if (UNIX)

http://git-wip-us.apache.org/repos/asf/kudu/blob/1cfdf36f/README.adoc
----------------------------------------------------------------------
diff --git a/README.adoc b/README.adoc
index 465c452..a096da7 100644
--- a/README.adoc
+++ b/README.adoc
@@ -260,6 +260,19 @@ This will scan any file which is dirty in your working tree, or changed since th
 gerrit-integrated upstream change in your git log. If you really want to do a full
 scan of the source tree, you may use the `lint` target instead.
 
+=== Running clang-tidy checks
+
+Kudu also uses the clang-tidy tool from LLVM to enforce coding style
+guidelines. You can run the tidy checks via cmake using the `tidy` target:
+
+[source,bash]
+----
+$ make tidy
+----
+
+This will scan any changes in the latest commit in the local tree. At the time
+of writing, it will not scan any changes that are not locally committed.
+
 === Building Kudu documentation
 
 Kudu's documentation is written in asciidoc and lives in the _docs_ subdirectory.