Enforcing New Line at End of File
The POSIX standard says a line should always end in a new line character. Tools and Text Editors are terrible at enforcing this.
This command makes sure all files end in a new line character.
find . -name '*.py' -exec perl -pi -0e '~s/\n*$/\n/' {} \;
You can tweak the find filters to match your project. The example finds all python files.