22
33# ######################################
44
5- required_command=" yapf unexpand "
5+ required_command=" yapf"
66code_directories=" pygem tests"
77
88# ######################################
@@ -38,31 +38,15 @@ for dir in $code_directories; do
3838done
3939[[ $# != 0 ]] && python_files=$@
4040
41- # The files unvhandler.py and params.py can not be formatted because there are
42- # strings with spaces inside that otherwise would be converted in tabs.
43- python_files_true=" "
44- for file in $python_files ; do
45- if [ $file != " pygem/unvhandler.py" ] && [ $file != " pygem/params.py" ]; then
46- python_files_true=" $python_files_true $file "
47- fi
48- done
4941
50- # Here the important part:
51- # - first, yapf format the files; it works very well just setting few option
52- # by command line, but at the moment it has bugs for tabs, so uses spaces.
53- # - second, convert 4 spaces to tab character
54- # - third, you can look a very pretty code
55- for file in $python_files_true ; do
42+ # Here the important part: yapf format the files.
43+ for file in $python_files ; do
5644 echo " Making beatiful $file ..."
5745 [[ ! -f $file ]] && echo " $file does not exist; $0 -h for more info" && exit
5846
5947 yapf --style=' {
6048 based_on_style: pep8,
6149 indent_width: 4,
62- dedent_closing_brackets = true,
63- coalesce_brackets = true,
64- column_limit = 80
50+ column_limit: 80
6551 }' -i $file
66- unexpand -t 4 $file > tmp.py
67- mv tmp.py $file
68- done
52+ done
0 commit comments