libgdx / gdx-liftoff

A modern setup tool for libGDX Gradle projects
Apache License 2.0
539 stars 50 forks source link

Request: Changes to .editorconfig #123

Closed ChristianPervoelz closed 1 year ago

ChristianPervoelz commented 1 year ago

Hi,

liftoff is creating an '.editorconfig' file when setting up a new project.

As nice as this is, it might not be suitable for everybody. For example I prefer to have indents of 2 in java, but liftoff sets it to 4.

That's not a big issue at all, I could disable the usage of editor config files in the IDE or change or delete the file, but I'm not really happy, that a tool that should (and does) ease my life, creates unexpected files and due to that 'modifies' the behavior of the IDE.

So my request (suggestion) is:

Thanks

tommyettinger commented 1 year ago

I think I could make .editorconfig optional to create, but it really isn't much different from just deleting it or replacing it for anyone who has different config preferences. Having it present by default, though, helps get rid of line ending troubles (the .gitattributes file also helps there), encoding issues, and space/tab indent mismatches. All of those are much worse to deal with for a hypothetical new user making their first project, compared to anyone changing indent_size = 4 to indent_size = 2 or other configuration. There's also the advantage of the skeletal file being there from the start, so the format for an .editorconfig file is clear to anyone who wants to edit it. My recommendation is to have an .editorconfig file you have configured how you want it (with your desired indent length), and just paste it into any new project. And if it gets committed to Git, then any collaborators will default to using your format settings, so they won't wind up reformatting your code in a way you don't like.

What I'm saying is, no project will be suitable for everybody out of the box, there's always some change that needs to be made for a project to become your project. (You're going to be writing code anyway!) The .editorconfig file is an opinionated set of defaults that is easily changed, and from the start it matches the format of code generated by Liftoff. I think the amount of formatting-related unpleasantness in new users' project that having a .editorconfig file helps alleviate, outweighs the amount of effort to copy in your own more-preferred file, or just change the number for indent_size if that's all it is.

ChristianPervoelz commented 1 year ago

Agreed, you're absolutely right about new users/developers.

Experienced devs should be experienced enough to handle it, so it's finally a question of philosophy.