Skip to content

Add EditorConfig file#1157

Open
FintasticMan wants to merge 1 commit intoInfiniTimeOrg:mainfrom
FintasticMan:add_editorconfig
Open

Add EditorConfig file#1157
FintasticMan wants to merge 1 commit intoInfiniTimeOrg:mainfrom
FintasticMan:add_editorconfig

Conversation

@FintasticMan
Copy link
Member

@yehoshuapw
Copy link
Contributor

isn't that what .clang-format does? (except more generic?)

@FintasticMan
Copy link
Member Author

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.

@yehoshuapw
Copy link
Contributor

EditorConfig actually changes the settings of your editor

neat. so like having a modeline (vim), but generic.

@FintasticMan
Copy link
Member Author

Exactly

@FintasticMan
Copy link
Member Author

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.

@Riksu9000
Copy link
Contributor

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 clang-format.

Comment on lines +3 to +7
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@FintasticMan FintasticMan added the maintenance Background work label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Background work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants