I have been “programming” in Lua for some time and Atom became quite a nice tool for that. I am looking for advice on tools to keep my code formatting consistent. This problem emerged since I have been asked to stick to certain styles in code formatting while applying Pull Requests to other projects on GitHub.
I am confused about how to configure
Atom. What would be your advice on tools to use? By formatting, I mean these things:
- keep 2 spaces for indentations
- remove trailing spaces
- remove extra trailing new lines on saving
- format code as you type
- format code as you paste
- some additional things like space after commas in comma-separated arguments inside functions
- spaces between special characters, etc.
I have been advised on different third-party modules on the top of those provided by Atom, two of which seems very popular:
- EditorConfig (with .editorconfig), and
- atom-beauty (with .jsbeautifyrc)
So far, EditotConfig does the work well but there is a conflict with the Whitespace module which I had to disable.
atom-beautify also works as a function on demand, e.g. to reformat old files. Then
EditorConfig takes over to format code in new files during typing.
The problem I have with
atom-beautify is it “beautifies” things I don’t want it to beautify and I have no idea how to configure it. For instance, it adds extra spaces between mathematical operands, such as “*” or “/”, which is annoying. I want spaces between
/. How can I do that?
I guess the final question is what would be your advice on tools to use? Atom is an open-source application with open source tools ready to install but while we have the freedom to choose from, it is also overwhelming