From cde2875a50b03fd2e4e645125d8a46f060833c9d Mon Sep 17 00:00:00 2001 From: Matej Ferencevic Date: Thu, 25 Apr 2019 16:36:58 +0200 Subject: [PATCH] Fix linter script Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1988 --- tools/arc-clang-tidy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/arc-clang-tidy b/tools/arc-clang-tidy index 7b7a1f6b8..3ef7620b8 100755 --- a/tools/arc-clang-tidy +++ b/tools/arc-clang-tidy @@ -1,9 +1,13 @@ -#!/bin/bash -e +#!/bin/bash ## Run this script through arc lint -if echo "$1" | egrep -q '.(cpp|hpp)$'; then - clang-tidy -quiet -p build "$1" -elif echo "$1" | egrep -q '.lcp$'; then - clang-tidy -quiet -p build "$1.cpp" "$(dirname $1)/$(basename $1 .lcp).hpp" +if echo "$1" | egrep -q '\.(cpp|hpp)$'; then + clang-tidy -quiet -p $( realpath build ) "$1" +elif echo "$1" | egrep -q '\.lcp$'; then + clang-tidy -quiet -p $( realpath build ) "$1.cpp" "$(dirname $1)/$(basename $1 .lcp).hpp" fi + +code=$? +[ $code -eq 1 ] && exit 0 +exit $code