But having a EditorConfig file means writing none compliant code becomes a defiant choice.
If you want the computer to make your entire codebase look roughly the same, you'll need more than a .editorconfig file...
(For C and C++, I've been quite pleased with clang-format, provided somebody else gets to set it up. Of course, as well as the code layout, it also sorts out tabs vs spaces, line ending type, and indent width.)
you just drop an .editorconfig at the root of your project and you'll know for sure that any code written by anyone will have the same indentation, encoding, and final newline config
I mean, the idea is great, but the small amount of parameters supported makes it pretty much useless. Indentation character and size, line termination, ... and that's all. I would need a hundred of these (like clang-format, yapf, etc have) to switch to EditorConfig. Unfortunately, looking at the commit log frequency, I doubt EditorConfig will ever have more than the 10 or so parameters that it already have.
No, it doesn't solve all the things. My experience is that it addresses one specific annoyance - team members checking in changes with varying line endings and spaces/tabs settings - and makes it a thing of the past.
For solving that one thing, I like it a lot.
It's only meant to automatically configure your editor to use the defined tab/space newline preferences per file type.
that's it.
No longer does JSON get the four spaces that Python does.
yes they have intersecting features, but EditorConfig's main feature is that it lets you set file type specific whitespace rules automatically, across almost all editors.
- Most editors will have a global whitespace rule and you have to use that same rule for every file.
- Some editors can be configured to have different rules per file type but then it can't be done per project. So every project has to use the same rules.
- Some editors will let you configure all of these per project, but you have to save this project-settings file somewhere. Editor specific code is no good in the repo, so you need to maintain/backup it yourself.
EditorConfig solves all of these issues for me.