Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can set up an Editorconfig[1] file to automatically fix trailing whitespace and insert the final newline, among other things. Most editors have support for it (either built-in or in a plugin).

It's a lifesaver when you care more about formatting than any of your coworkers and can set up something that handles it for them.

Additionally, configuring editors/IDEs to format code when the file is saved is very useful to enforce formatting rules.

[1]: https://editorconfig.org/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: