Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
b21a30bd
Unverified
Commit
b21a30bd
authored
Oct 06, 2020
by
Stas Bekman
Committed by
GitHub
Oct 06, 2020
Browse files
[makefile] check only .py files (#7588)
* check only .py files * better choice of words
parent
d5d2744a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Makefile
Makefile
+9
-9
No files found.
Makefile
View file @
b21a30bd
...
@@ -5,18 +5,18 @@ check_dirs := examples templates tests src utils
...
@@ -5,18 +5,18 @@ check_dirs := examples templates tests src utils
# get modified files since the branch was made
# get modified files since the branch was made
fork_point_sha
:=
$(
shell
git merge-base
--fork-point
master
)
fork_point_sha
:=
$(
shell
git merge-base
--fork-point
master
)
joined_dirs
:=
$(
shell
echo
$(check_dirs)
|
tr
" "
"|"
)
joined_dirs
:=
$(
shell
echo
$(check_dirs)
|
tr
" "
"|"
)
modified_files
:=
$(
shell
git diff
--name-only
$(fork_point_sha)
| egrep
'^(
$(joined_dirs)
)
'
)
modified_
py_
files
:=
$(
shell
git diff
--name-only
$(fork_point_sha)
| egrep
'^(
$(joined_dirs)
)
'
| egrep
'\.py$$'
)
#$(info modified files are: $(modified_files))
#$(info modified files are: $(modified_
py_
files))
modified_only_fixup
:
modified_only_fixup
:
@
if
[
-n
"
$(modified_files)
"
]
;
then
\
@
if
[
-n
"
$(modified_
py_
files)
"
]
;
then
\
echo
"Checking/fixing
$(modified_files)
"
;
\
echo
"Checking/fixing
$(modified_
py_
files)
"
;
\
black
$(modified_files)
;
\
black
$(modified_
py_
files)
;
\
isort
$(modified_files)
;
\
isort
$(modified_
py_
files)
;
\
flake8
$(modified_files)
;
\
flake8
$(modified_
py_
files)
;
\
else
\
else
\
echo
"No
relevant
files were modified"
;
\
echo
"No
library .py
files were modified"
;
\
fi
fi
# Check that source code meets quality standards
# Check that source code meets quality standards
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment