mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 05:10:06 +06:00
[makefile] check only .py files (#7588)
* check only .py files * better choice of words
This commit is contained in:
parent
d5d2744aa7
commit
b21a30bdd8
18
Makefile
18
Makefile
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user