Add .editorconfig file for basic formatting
PATCH 1/1 Add .editorconfig file for basic formatting
EditorConfig is a specification to define the most basic code formatting stuff, and it's supported by many editors and IDEs, either directly or via plugins, including Vim and emacs.
It allows to define formatting style related to indentation, charset, end of lines and trailing whitespaces. It also allows to apply different formats for different files based on wildcards, so for example it is possible to apply different configs to *.{c,h}, *.py and *.rs.
In linux project, defining a .editorconfig might help to those people that work on different projects with different indentation styles, so they cannot define a global style. Now they will directly see the correct indentation on every fresh clone of the project.
--- .editorconfig | 19 +++++++++++++++++++ .gitignore | 1 + 2 files changed, 20 insertions(+) create mode 100644 .editorconfig
.editorconfig new file +19 -0
@@ -0,0 +1,19 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{c,h}] +indent_style = tab +indent_size = 8 + +[{Makefile,Makefile.*,*.mk}] +indent_style = tab +indent_size = 8 + +[*.{py,rs}] +indent_style = space +indent_size = 4
.gitignore +1 -0
@@ -102,6 +102,7 @@ modules.order !.gitignore !.mailmap !.rustfmt.toml +!.editorconfig # # Generated include files
Signature · 1 line
2.34.3