style: add .editorconfig

See https://editorconfig.org/#example-file
This commit is contained in:
Calcitem 2021-11-07 10:50:15 +08:00 committed by Nikolas Rimikis
parent 9b99437103
commit ce4e4ae718
2 changed files with 32 additions and 1 deletions

31
.editorconfig Normal file
View File

@ -0,0 +1,31 @@
root = true
[*]
charset = utf-8
trim_trailing_whitespace = true
[*.{cpp,c,hpp,h,py}]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
[*.dart]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
[*.{java,m,md}]
indent_style = space
end_of_line = lf
insert_final_newline = true
[*.json]
indent_style = space
[{*.sh,Makefile}]
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true

View File

@ -20,4 +20,4 @@ with open(csv_file_path, mode='w', encoding='utf8') as csv_file:
fieldnames = ['key', 'string']
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
for key in list(intl_dict):
writer.writerow({'key': key, 'string': intl_dict[key]})
writer.writerow({'key': key, 'string': intl_dict[key]})