Conversation
|
isn't that what .clang-format does? (except more generic?) |
|
There is a slight difference. EditorConfig actually changes the settings of your editor, whereas clang-format runs on already written files. For example, I use vim, and I have it setup to use a soft tab size of 4, which means that as I'm writing code in this repository the indentation is messed up until I run clang-format. With this EditorConfig file it reconfigures my editor to use a soft tab size of 2 while I'm writing the code. |
neat. so like having a modeline (vim), but generic. |
|
Exactly |
089ff3c to
87b5560
Compare
b5794df to
a1e8ec0
Compare
|
Does this look good now? I think that it is quite accurate to the coding style that is used in this project. Seeing as it only adds one file that doesn't have any influence on the built firmware and changes the indentation of one file, it should be pretty simple to merge. I find it very useful as I'm writing code, so that I don't need to be constantly adjusting the indentation. |
|
Maybe there aren't many using EditorConfig, which makes it harder to review. My editor just picks up the settings from the opened file and there's always |
| [*] | ||
| end_of_line = lf | ||
| charset = utf-8 | ||
| insert_final_newline = true | ||
|
|
There was a problem hiding this comment.
I think this might make this more difficult to maintain, since if a file was added that requires different settings, it always requires changing this config, but it would likely not be noticed. Maybe it would be best to only explicitly mention which places should be formatted which way.
There was a problem hiding this comment.
I think that it's unlikely for a file to need different settings than those, but if you think it would make more sense to put them in the more specific section, I can.
Also change python formatting to use indent size of 2
a1e8ec0 to
48a228a
Compare
See https://editorconfig.org/.