blob: f8b9f38fdb1b53110824c5a177480e6325e14293 [file] [log] [blame]
Jan Kundrátfd2386f2019-02-27 17:41:23 +01001- name: Run test_command
2 shell: |
3 OUT='{{ ansible_user_dir }}/zuul-output/logs/git-clang-format.patch'
4 git-clang-format --quiet --diff --style file 'origin/{{ zuul.branch }}' | tee "${OUT}"
5 if [[ "$(head -n 1 ${OUT})" == "no modified files to format" ]]; then
6 # no usable exit code for this...
7 rm -f "${OUT}"
8 exit 0
9 elif [[ -s "${OUT}" ]]; then
10 # ...whereas this one exits with 0...
11 exit 1
12 else
13 rm -f "${OUT}"
14 exit 0
15 fi
16 args:
17 chdir: '{{ zuul.project.src_dir }}'