File | Settings | Editor --> Ensure blank line before end of file on Save