Add ci task to fail on code-style (yapf)
This commit is contained in:
parent
7b164fa5ae
commit
9536cc4377
2 changed files with 7 additions and 4 deletions
|
@ -3,11 +3,13 @@ platform: linux
|
|||
inputs:
|
||||
- name: quay-pull-request
|
||||
run:
|
||||
path: /bin/sh
|
||||
path: /bin/bash
|
||||
args:
|
||||
- -c
|
||||
- |
|
||||
set -eux
|
||||
pip install --quiet -r quay-pull-request/requirements-dev.txt
|
||||
cd quay-pull-request
|
||||
yapf -d -r .
|
||||
export GIT_MERGE_BASED=`git merge-base origin/master HEAD`
|
||||
export MODIFIED_FILES=`git diff --name-only $(GIT_MERGE_BASED) | grep -E .+\.py$ | paste -sd ' '`
|
||||
if [ `yapf -d -p $(MODIFIED_FILES) | wc -l` -gt 0 ] ; then false ; else true ;fi
|
||||
|
|
Reference in a new issue