File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,8 @@ echo '--------------------------------------------------------------------------
120120# uses git 1.8.
121121# We need the following command to exit with 0 hence the echo in case
122122# there is no match
123- MODIFIED_FILES=" $( git diff --name-only $COMMIT_RANGE || echo " no_match" ) "
123+ MODIFIED_FILES=" $( git diff --name-only $COMMIT_RANGE | grep -v ' doc'
124+ || echo " no_match" ) "
124125
125126check_files () {
126127 files=" $1 "
@@ -130,8 +131,12 @@ check_files() {
130131 git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --diff --show-source $options
131132}
132133
133- check_files " $( echo " $MODIFIED_FILES " | grep -v ^examples) "
134- # Examples are allowed to not have imports at top of file
135- check_files " $( echo " $MODIFIED_FILES " | grep ^examples) " --ignore=E402
134+ if [[ " $MODIFIED_FILES " == " no_match" ]]; then
135+ echo " No file outside doc has been modified"
136+ else
137+ check_files " $( echo " $MODIFIED_FILES " | grep -v ^examples) "
138+ # Examples are allowed to not have imports at top of file
139+ check_files " $( echo " $MODIFIED_FILES " | grep ^examples) " --ignore=E402
140+ fi
136141
137142echo -e " No problem detected by flake8\n"
You can’t perform that action at this time.
0 commit comments