]> granicus.if.org Git - curl/commitdiff
Makefile: add 'tidy' target that runs clang-tidy
authorDaniel Stenberg <daniel@haxx.se>
Mon, 22 Oct 2018 22:33:27 +0000 (00:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 27 Oct 2018 13:59:38 +0000 (15:59 +0200)
Available in the root, src and lib dirs.

Closes #3163

Makefile.am
lib/Makefile.am
src/Makefile.am

index dd93a383e7aa8569108cff86e35c75e1b481fbf9..debec9aa3d6a9901818526f285a16189fc0f5ce3 100644 (file)
@@ -5,7 +5,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
@@ -642,3 +642,7 @@ function gen_element(type, dir, file)\
                -v src_x_srcs="$$sorted_src_x_srcs" \
                -v src_x_hdrs="$$sorted_src_x_hdrs" \
                "$$awk_code" $(srcdir)/$(VC15_SRCTMPL) > $(VC15_SRCVCXPROJ) || { exit 1; };)
+
+tidy:
+       (cd src && $(MAKE) tidy)
+       (cd lib && $(MAKE) tidy)
index 4f3c16db444c223b3c09267cf516b4ef17160e76..a7b5262b9181f917b8dd1b1654cc4aeafd366a02 100644 (file)
@@ -144,3 +144,11 @@ if CURLDEBUG
 # for debug builds, we scan the sources on all regular make invokes
 all-local: checksrc
 endif
+
+# disable the tests that are mostly causing false positives
+TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference -quiet
+
+TIDY:=clang-tidy
+
+tidy:
+       $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
index 80cbce206075e06532c9b168d2f7293239ef71c4..8fd9dc32dbcd111ce69b4a7f2e3cc38015268217 100644 (file)
@@ -140,3 +140,11 @@ if CURLDEBUG
 # for debug builds, we scan the sources on all regular make invokes
 all-local: checksrc
 endif
+
+# disable the tests that are mostly causing false positives
+TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference
+
+TIDY:=clang-tidy
+
+tidy:
+       $(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H