Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
remove empty lines at the end of every scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Nov 8, 2014
1 parent dbaada8 commit 9485dee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_setup_help_on_windows.bat
Expand Up @@ -18,6 +18,7 @@ c:\Python34vir\install\Scripts\python -u setup.py install
echo #######################################################

set pythonexe="c:\Python34\python"
%pythonexe% -u setup.py clean_space
%pythonexe% -u setup.py unittests
echo #######################################################

Expand Down
5 changes: 5 additions & 0 deletions src/pyquickhelper/pycode/code_helper.py
Expand Up @@ -17,6 +17,11 @@ def remove_extra_spaces(filename):
lines = f.readlines()

lines2 = [ _.rstrip(" \r\n") for _ in lines ]
last = len(lines2)-1
while last >= 0 and len(lines2[last]) == 0 :
last -= 1
last+=1
lines2 = lines2[:last]

diff = len("".join(lines)) - len("\n".join(lines2))
if diff != 0:
Expand Down

0 comments on commit 9485dee

Please sign in to comment.