config: update `.editorconfig` parameters according to current format of files (#6696)

* config: addopt current file formatting as yml & markdown parametrization

Cherry picked from EbookFoundation/free-programming-books#5564: e9f7dff3be87e640a72f97bd4eec1be79ec2b43a

* add config properties for JSON files

* extend config to all markdown file extensions

* sort global properties

* add mapping for python files

* add windows batch files mapping

* sort mapping entries

* add makefile mapping properties

* add file description / summary

* add poweshell mappings

* Comment each section

* disable linebreaks on supported editors

* Apply some suggestions

* clean deadcode

- simplify properties already defined in global section
- remove not used future patterns
pull/6779/merge
David Ordás 2022-03-16 20:45:02 +01:00 committed by GitHub
parent 5a331c73c3
commit b5821e15f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 41 additions and 5 deletions

View File

@ -1,13 +1,49 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org # editorconfig.org
; top-most EditorConfig file
root = true root = true
; define basic and global for any file
[*] [*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true insert_final_newline = true
max_line_length = off
trim_trailing_whitespace = true
curly_bracket_next_line = false
spaces_around_operators = true
[*.md] ; DOS/Windows batch scripts -
[*.{bat,cmd}]
end_of_line = crlf
; JavaScript files -
[*.{js,ts}]
curly_bracket_next_line = true
quote_type = single
; JSON files (normal and commented version) -
[*.{json,jsonc}]
indent_size = 2
quote_type = double
; Make - match it own default syntax
[Makefile]
indent_style = tab
; Markdown files - preserve trail spaces that means break line
[*.{md,markdown}]
trim_trailing_whitespace = false trim_trailing_whitespace = false
; PowerShell - match defaults for New-ModuleManifest and PSScriptAnalyzer Invoke-Formatter
[*.{ps1,psd1,psm1}]
charset = utf-8-bom
end_of_line = crlf
; YML config files - match it own default syntax
[*.{yaml,yml}]
indent_size = 2