Looks like 99% of this is covered by my editor being configured to autodetect existing indentation, and adjust itself accordingly: https://github.com/ciaranm/detectindent
EditorConfig – file format for defining coding styles and text editor plugins
21–30 of 32 posts
Re: EditorConfig – file format for defining coding styles and text editor plugins
#22Looks like 99% of this is covered by my editor being configured to autodetect existing indentation, and adjust itself accordingly: https://github.com/ciaranm/detectindent
But having a EditorConfig file means writing none compliant code becomes a defiant choice.
Re: EditorConfig – file format for defining coding styles and text editor plugins
#23Looks like 99% of this is covered by my editor being configured to autodetect existing indentation, and adjust itself accordingly: https://github.com/ciaranm/detectindent
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
Re: EditorConfig – file format for defining coding styles and text editor plugins
#24Earlier quoted context omitted.
and now we have https://prettier.io/docs/en/why-prettier.html we can automatically enforce and fix all these style rules
I haven't used prettier but eslint can also fix style
Re: EditorConfig – file format for defining coding styles and text editor plugins
#25Looks like 99% of this is covered by my editor being configured to autodetect existing indentation, and adjust itself accordingly: https://github.com/ciaranm/detectindent
it's meant to be used within teams, with people who might not have the same editor (or the same set of plugins) as you 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
Re: EditorConfig – file format for defining coding styles and text editor plugins
#26Looks like 99% of this is covered by my editor being configured to autodetect existing indentation, and adjust itself accordingly: https://github.com/ciaranm/detectindent
I think you might be missing the point, not everyone (your collaborators) will use the same editor, the same white-space rules. And some developers couldn't care less about consistent code and quality at all. 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.)
Re: EditorConfig – file format for defining coding styles and text editor plugins
#27Re: EditorConfig – file format for defining coding styles and text editor plugins
#28I prefer tabs to spaces, not here to argue, and editorconfig is read by GitHub and let's me change tabs to display as 4 spaces instead of eight. A major win. Also allows me to default their editor to tabs.
Re: EditorConfig – file format for defining coding styles and text editor plugins
#29EditorConfig is awesome, especially for a distributed remote team. I've standardized everyone whom I ever worked with few initial project settings and EditorConfig is such one must-do item. Been using it (I think) for the past 5 years or so.
No longer does JSON get the four spaces that Python does.
Re: EditorConfig – file format for defining coding styles and text editor plugins
#30Before clicking on the link, I thought "Oh, just another attempt at standardizing editor preferences from a file in a repo." But looking at their list of editors which natively support EditorConfig and the list of plugins for editors which don't, this is far better support than I imagined. This is it! Problem solved.
Honestly I don't think much is solved by EditorConfig. 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…