code style: remove trailing spaces, and add EOL on last lines