File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
33base_dir=$( dirname $( dirname $0 ) )
4+ targets=" ${base_dir} /*.py ${base_dir} /examples/ ${base_dir} /keras_nlp/"
45
5- isort --sl ${base_dir}
6- black --line-length 80 ${base_dir }
6+ isort --sp " ${base_dir} /setup.cfg " --sl ${targets }
7+ black --line-length 80 ${targets }
78
8- for i in $( find ${base_dir } -name ' *.py' ) ; do
9+ for i in $( find ${targets } -name ' *.py' ) ; do
910 if ! grep -q Copyright $i ; then
1011 echo $i
1112 cat shell/copyright.txt $i > $i .new && mv $i .new $i
1213 fi
1314done
1415
15- flake8 ${base_dir}
16+ flake8 --config " ${base_dir} /setup.cfg " ${targets }
Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
33base_dir=$( dirname $( dirname $0 ) )
4+ targets=" ${base_dir} /*.py ${base_dir} /examples/ ${base_dir} /keras_nlp/"
45
5- isort --sl -c " ${base_dir} "
6+ isort --sp " ${base_dir} /setup.cfg " -- sl -c ${targets}
67if ! [ $? -eq 0 ]; then
78 echo " Please run \" ./shell/format.sh\" to format the code."
89 exit 1
910fi
10- flake8 " ${base_dir} "
11+
12+ flake8 --config " ${base_dir} /setup.cfg" ${targets}
1113if ! [ $? -eq 0 ]; then
1214 echo " Please fix the code style issue."
1315 exit 1
1416fi
15- black --check --line-length 80 " ${base_dir} "
17+
18+ black --check --line-length 80 ${targets}
1619if ! [ $? -eq 0 ]; then
1720 echo " Please run \" ./shell/format.sh\" to format the code."
1821 exit 1
1922fi
20- for i in $( find " ${base_dir} " -name ' *.py' ) ; do
23+ for i in $( find ${targets} -name ' *.py' ) ; do
2124 if ! grep -q Copyright $i ; then
2225 echo " Please run \" ./shell/format.sh\" to format the code."
2326 exit 1
You can’t perform that action at this time.
0 commit comments