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 '--------------------------------------------------------------------------
120
120
# uses git 1.8.
121
121
# We need the following command to exit with 0 hence the echo in case
122
122
# 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" ) "
124
125
125
126
check_files () {
126
127
files=" $1 "
@@ -130,8 +131,12 @@ check_files() {
130
131
git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --diff --show-source $options
131
132
}
132
133
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
136
141
137
142
echo -e " No problem detected by flake8\n"
You can’t perform that action at this time.
0 commit comments