ok/jj
1
0
Fork 0
forked from mirrors/jj

editorconfig: disable trim_trailing_whitespace due to multi-line bugs

The `trim_trailing_whitespace` config is not working well with
multi-line string literals. I've tried to work around
intellij-rust/intellij-rust#5368 twice and now I want to use the
`insta` crate so I'd need to find another workaround. Let's just
disable the config instead. I wouldn't be surprised if other editors
have similar bugs as IntelliJ.
This commit is contained in:
Martin von Zweigbergk 2022-03-05 20:06:12 -08:00 committed by Martin von Zweigbergk
parent 891641670c
commit 0c1734a19d
2 changed files with 14 additions and 7 deletions

View file

@ -2,7 +2,9 @@ root = true
[*]
end_of_line = lf
trim_trailing_whitespace = true
# Turned off because some editors otherwise remove trailing spaces within
# multi-line string literals (intellij-rust/intellij-rust#5368).
trim_trailing_whitespace = false
[*.rs]
indent_style = space

View file

@ -24,8 +24,10 @@ fn smoke_test() {
let repo_path = test_env.env_root().join("repo");
// Check the output of `jj status` right after initializing repo
let expected_output =
"Parent commit: 000000000000 \nWorking copy : 1d1984a23811 \nThe working copy is clean\n";
let expected_output = "Parent commit: 000000000000
Working copy : 1d1984a23811
The working copy is clean
";
test_env
.jj_cmd(&repo_path, &["status"])
.assert()
@ -38,8 +40,9 @@ fn smoke_test() {
std::fs::write(repo_path.join("file3"), "file3").unwrap();
// The working copy's ID should have changed
let expected_output = "Parent commit: 000000000000 \nWorking copy : 5e60c5091e43 \nWorking \
copy changes:
let expected_output = "Parent commit: 000000000000
Working copy : 5e60c5091e43
Working copy changes:
A file1
A file2
A file3
@ -58,7 +61,8 @@ A file3
.stdout(expected_output);
// Add a commit description
let expected_output = "Working copy now at: 6f13b3e41065 add some files\n";
let expected_output = "Working copy now at: 6f13b3e41065 add some files
";
test_env
.jj_cmd(&repo_path, &["describe", "-m", "add some files"])
.assert()
@ -66,7 +70,8 @@ A file3
.stdout(expected_output);
// Close the commit
let expected_output = "Working copy now at: 6ff8a22d8ce1 \n";
let expected_output = "Working copy now at: 6ff8a22d8ce1
";
test_env
.jj_cmd(&repo_path, &["close"])
.assert()