Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions code_formatter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#######################################

required_command="yapf unexpand"
required_command="yapf"
code_directories="pygem tests"

#######################################
Expand Down Expand Up @@ -38,31 +38,15 @@ for dir in $code_directories; do
done
[[ $# != 0 ]] && python_files=$@

# The files unvhandler.py and params.py can not be formatted because there are
# strings with spaces inside that otherwise would be converted in tabs.
python_files_true=""
for file in $python_files; do
if [ $file != "pygem/unvhandler.py" ] && [ $file != "pygem/params.py" ]; then
python_files_true="$python_files_true $file"
fi
done

# Here the important part:
# - first, yapf format the files; it works very well just setting few option
# by command line, but at the moment it has bugs for tabs, so uses spaces.
# - second, convert 4 spaces to tab character
# - third, you can look a very pretty code
for file in $python_files_true; do
# Here the important part: yapf format the files.
for file in $python_files; do
echo "Making beatiful $file..."
[[ ! -f $file ]] && echo "$file does not exist; $0 -h for more info" && exit

yapf --style='{
based_on_style: pep8,
indent_width: 4,
dedent_closing_brackets = true,
coalesce_brackets = true,
column_limit = 80
column_limit: 80
}' -i $file
unexpand -t 4 $file > tmp.py
mv tmp.py $file
done
done
6 changes: 3 additions & 3 deletions pygem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
"""
__all__ = [
'affine', 'filehandler', 'freeform', 'radial', 'openfhandler', 'params',
'stlhandler', 'unvhandler', 'vtkhandler', 'nurbshandler', 'stephandler',
'igeshandler', 'utils', 'gui', 'khandler', 'idw', 'params_idw'
'affine', 'filehandler', 'freeform', 'radial', 'openfhandler', 'params',
'stlhandler', 'unvhandler', 'vtkhandler', 'nurbshandler', 'stephandler',
'igeshandler', 'utils', 'gui', 'khandler', 'idw', 'params_idw'
]

from . import affine
Expand Down
Loading