Skip to content

Commit

Permalink
fix(style): better .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Nov 12, 2023
1 parent 67dc163 commit 0b779d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 35 deletions.
19 changes: 6 additions & 13 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

# Whitespace at the end of lines
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,json}]
charset = utf-8
indent_size = 2

[*.py]
charset = utf-8
[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml,md,rb}]
[*.{js,json,json5,yml,yaml,md,rb}]
indent_size = 2

[Makefile]
Expand Down
19 changes: 6 additions & 13 deletions src/nitpick/resources/any/editorconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,17 @@ root = true

[".editorconfig"."*"]
# Unix-style newlines with a newline ending every file
charset = "utf-8"
end_of_line = "lf"
insert_final_newline = true
indent_style = "space"
indent_size = 4

# Whitespace at the end of lines
indent_style = "space"
insert_final_newline = true
trim_trailing_whitespace = true

# Matches multiple files with brace expansion notation
# Set default charset
[".editorconfig"."*.{js,json}"]
charset = "utf-8"
indent_size = 2

[".editorconfig"."*.py"]
charset = "utf-8"
[".editorconfig"."*.{bat,cmd,ps1}"]
end_of_line = "crlf"

[".editorconfig"."*.{yml,yaml,md,rb}"]
[".editorconfig"."*.{js,json,json5,yml,yaml,md,rb}"]
indent_size = 2

[".editorconfig".Makefile]
Expand Down
15 changes: 6 additions & 9 deletions tests/test_builtin/any/editorconfig/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
root = True

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = True
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = True
trim_trailing_whitespace = True

[*.py]
charset = utf-8

[*.{js,json}]
charset = utf-8
indent_size = 2
[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml,md,rb}]
[*.{js,json,json5,yml,yaml,md,rb}]
indent_size = 2

[Makefile]
Expand Down

0 comments on commit 0b779d9

Please sign in to comment.