Fix wrong var check in clang-pipeline

presentation
Ulrich Huber 7 years ago
parent a2d172c539
commit 09be17de09
  1. 4
      azure-pipelines/clang-format-applied.yml

@ -23,14 +23,14 @@ stages:
git fetch origin +$(Build.SourceBranch)
echo "List of modified files:"
git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch))
git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch)) | grep ".cpp$\|.hpp$\|.h$
# Actually get the list in a parsable state
LOMF=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch)) | grep ".cpp$\|.hpp$\|.h$")
# Checkout the PR again so we can check the modified files for correct format
git checkout FETCH_HEAD
if [ -n "$VAR" ]; then
if [ -n "$LOMF" ]; then
# Apply clang-format to enforce proper format
clang-format -i -style=file $LOMF
# All previously badly formatted files should now be modified

Loading…
Cancel
Save