trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] 02/02: Improve clang-tidy compatibility.
Date Thu, 08 Sep 2016 05:00:38 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 42803e71805b425c89d6a3642ad6629e1e9a14b6
Author: James Peach <jpeach@apache.org>
AuthorDate: Wed Sep 7 21:50:22 2016 -0700

    Improve clang-tidy compatibility.
    
    Clearly separate C and C++ files for clang-tidy to process them
    without eating them. Remove header files from the set of tidied
    files since they rarely compile by themselves.
---
 build/tidy.mk                                           | 7 ++++---
 example/Makefile.am                                     | 1 +
 plugins/experimental/hipes/Makefile.am                  | 2 +-
 plugins/experimental/remap_purge/Makefile.am            | 3 +++
 plugins/experimental/stale_while_revalidate/Makefile.am | 2 +-
 plugins/experimental/url_sig/Makefile.am                | 2 +-
 plugins/libloader/Makefile.am                           | 2 +-
 plugins/regex_revalidate/Makefile.am                    | 2 +-
 plugins/stats_over_http/Makefile.am                     | 2 +-
 9 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/build/tidy.mk b/build/tidy.mk
index a0d16fc..96ccd07 100644
--- a/build/tidy.mk
+++ b/build/tidy.mk
@@ -20,7 +20,8 @@ Clang_Tidy_Options = -fix -fix-errors
 # just the C and C++ sources so we don't pick up lex and yacc files
 # for example.
 
-Clang_Tidy_Files = $(filter %.cc %.c %.h %.hpp,$(sort $(1)))
+Clang_Tidy_CC_Files = $(filter %.c, $(sort $(1)))
+Clang_Tidy_CXX_Files = $(filter %.cc, $(sort $(1)))
 
 #clang-tidy rules. We expect these to be actions with something like
 #$(DIST_SOURCES) as the dependencies.rules. Note that $DIST_SOURCES
@@ -29,5 +30,5 @@ Clang_Tidy_Files = $(filter %.cc %.c %.h %.hpp,$(sort $(1)))
 #
 #All this clearly requires GNU make.
 
-CXX_Clang_Tidy = $(CLANG_TIDY) $(Clang_Tidy_Options) $(call Clang_Tidy_Files,$^) -- $(CXXCOMPILE)
-x c++
-CC_Clang_Tidy = $(CLANG_TIDY) $(Clang_Tidy_Options) $(call Clang_Tidy_Files,$^) -- $(COMPILE)
-x c
+CXX_Clang_Tidy = $(CLANG_TIDY) $(Clang_Tidy_Options) $(call Clang_Tidy_CXX_Files,$^) -- $(CXXCOMPILE)
-x c++
+CC_Clang_Tidy = $(CLANG_TIDY) $(Clang_Tidy_Options) $(call Clang_Tidy_CC_Files,$^) -- $(COMPILE)
-x c
diff --git a/example/Makefile.am b/example/Makefile.am
index 917702f..2121613 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -92,3 +92,4 @@ include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
 	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)
diff --git a/plugins/experimental/hipes/Makefile.am b/plugins/experimental/hipes/Makefile.am
index 4eade47..2c76a03 100644
--- a/plugins/experimental/hipes/Makefile.am
+++ b/plugins/experimental/hipes/Makefile.am
@@ -24,4 +24,4 @@ hipes_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CC_Clang_Tidy)
+	$(CXX_Clang_Tidy)
diff --git a/plugins/experimental/remap_purge/Makefile.am b/plugins/experimental/remap_purge/Makefile.am
index 57ae8cf..5b03bfb 100644
--- a/plugins/experimental/remap_purge/Makefile.am
+++ b/plugins/experimental/remap_purge/Makefile.am
@@ -19,3 +19,6 @@ include $(top_srcdir)/build/plugins.mk
 pkglib_LTLIBRARIES = remap_purge.la
 remap_purge_la_SOURCES = remap_purge.c
 remap_purge_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
+
+tidy-local: $(DIST_SOURCES)
+	$(CC_Clang_Tidy)
diff --git a/plugins/experimental/stale_while_revalidate/Makefile.am b/plugins/experimental/stale_while_revalidate/Makefile.am
index a172f7f..10e1835 100644
--- a/plugins/experimental/stale_while_revalidate/Makefile.am
+++ b/plugins/experimental/stale_while_revalidate/Makefile.am
@@ -23,4 +23,4 @@ stale_while_revalidate_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)
diff --git a/plugins/experimental/url_sig/Makefile.am b/plugins/experimental/url_sig/Makefile.am
index 97d736b..fb0e011 100644
--- a/plugins/experimental/url_sig/Makefile.am
+++ b/plugins/experimental/url_sig/Makefile.am
@@ -23,4 +23,4 @@ url_sig_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)
diff --git a/plugins/libloader/Makefile.am b/plugins/libloader/Makefile.am
index e52c617..ea92fe6 100644
--- a/plugins/libloader/Makefile.am
+++ b/plugins/libloader/Makefile.am
@@ -23,4 +23,4 @@ libloader_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)
diff --git a/plugins/regex_revalidate/Makefile.am b/plugins/regex_revalidate/Makefile.am
index 62f4cc8..abbec68 100644
--- a/plugins/regex_revalidate/Makefile.am
+++ b/plugins/regex_revalidate/Makefile.am
@@ -23,4 +23,4 @@ regex_revalidate_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)
diff --git a/plugins/stats_over_http/Makefile.am b/plugins/stats_over_http/Makefile.am
index d92d815..caea205 100644
--- a/plugins/stats_over_http/Makefile.am
+++ b/plugins/stats_over_http/Makefile.am
@@ -23,4 +23,4 @@ stats_over_http_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 include $(top_srcdir)/build/tidy.mk
 
 tidy-local: $(DIST_SOURCES)
-	$(CXX_Clang_Tidy)
+	$(CC_Clang_Tidy)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message