From e9df0f17db4ea58ca20edb3613a8cfd33e1485a4 Mon Sep 17 00:00:00 2001 From: Brian Bowman Date: Tue, 19 Jul 2022 04:37:34 -0500 Subject: [PATCH] Tweak .editorconfig and line endings - Use `lf` line endings everywhere. This works fine even on Windows, and is more common for git repos. It also matches prettier's default. For .editorconfig: - Remove `insert_final_newline = false`: Omitting the final newline isn't supported by prettier or rustfmt. - Remove `trim_trailing_whitespace = false`: The formatters will remove trailing whitespace anyways. I can't think of a good reason to want to keep trailing whitespace. - Remove other redundant options. --- .editorconfig | 17 ++--------------- .gitattributes | 1 + src-tauri/rustfmt.toml | 1 + 3 files changed, 4 insertions(+), 15 deletions(-) create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig index 813f40d..5dc7457 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,22 +2,9 @@ root = true [*] charset = utf-8 -end_of_line = crlf +end_of_line = lf indent_size = 2 indent_style = space -insert_final_newline = false max_line_length = 120 tab_width = 2 -trim_trailing_whitespace = false - -[*.rs] -max_line_length = 100 -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[{*.ats,*.cts,*.mts,*.ts}] -indent_size = 2 - -[*.json] -indent_size = 2 \ No newline at end of file +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/src-tauri/rustfmt.toml b/src-tauri/rustfmt.toml index 2f9c1b2..28dc59f 100644 --- a/src-tauri/rustfmt.toml +++ b/src-tauri/rustfmt.toml @@ -1,3 +1,4 @@ +newline_style = "Unix" tab_spaces = 2 use_field_init_shorthand = true use_try_shorthand = true