From d259a87d031f01f5551583a08f52edf700bd5c2c Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 30 Apr 2019 15:02:55 +0100 Subject: [PATCH] Make clang-tidy fail when it ought to. clang-tidy exits with an error code of 0 if the code compiles, even if there are warnings. Make it generate a file with the errors and fail the test if this file exists. Also remove the -fix flag - we don't want clang-tidy to fix things in CI (yet?). --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 66cb3f1..6a95fda 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -217,6 +217,7 @@ phases: displayName: 'Clang-Format' - script: | - clang-tidy-8 src/override/malloc.cc -header-filter="`pwd`/*" -fix -- -std=c++17 -mcx16 + clang-tidy-8 src/override/malloc.cc -header-filter="`pwd`/*" -export-fixes=tidy.fail -- -std=c++17 -mcx16 + if [ -f tidy.fail ] ; then exit 1 ; fi displayName: 'Clang-Tidy'