Add .editorconfig - #1317
Conversation
|
It might be a good idea to add a separate section for |
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 2 |
There was a problem hiding this comment.
No particular reason, just seems to be a popular choice. Some of the .c files seem to be using 2 spaces (example) and some of the .wat files also use 2 spaces (example). However, sometimes there is an inconsistent mix of 2 and 4 spaces (example).
I think it would be fine to leave indent_size unset if the choice is controversial.
There was a problem hiding this comment.
I think either way is fine. Our plan is to rewrite the remaining handful of .cpp files into Rust anyway :-).
|
One thing I'm unclear on about editorconfig files; we already have a .rustfmt file, and we use all default settings; shouldn't we expect editors to either read the .rustfmt file, or at least default to rustfmt's defaults? |
|
|
|
@sunfishcode the The main thing I find useful about having the |
|
I think this might be extra-helpful if it told IDEs to wrap lines to a certain length; I tend to forget to do that for non-Rust files. |
|
For LF line endings, should we add a .gitattributes file containing |
|
Yeah the |
|
I submitted #1370 to add a .gitattributes file, following your suggestion. If anyone has a clear need for a .editorconfig file beyond that, we can add it, but otherwise my sense is to wait until we have one. #1365 has now removed most of the remaining C++ code from the repo, which further simplifies things. |
|
Sounds good. I'll close this in favor of the other PR. |
This PR adds a basic EditorConfig file.