`taplo fmt --check -diff` false positive on windows
Run taplo fmt --check --diff
taplo fmt --check --diff
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
CARGO_HOME: C:\Users\runneradmin/.cargo
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CACHE_ON_FAILURE: false
INFO taplo:format_files:collect_files: found files total=[3](https://github.com/jmgao/pore/actions/runs/14044977210/job/39323643851#step:6:3) excluded=0 cwd="D:/a/pore/pore"
diff a/D:/a/pore/pore/.rustfmt.toml b/D:/a/pore/pore/.rustfmt.toml
--- a/D:/a/pore/pore/.rustfmt.toml
+++ b/D:/a/pore/pore/.rustfmt.toml
@@ -0,0 +0,0 @@
ERROR taplo:format_files: the file is not properly formatted path="D:/a/pore/pore/.rustfmt.toml"
diff a/D:/a/pore/pore/Cargo.toml b/D:/a/pore/pore/Cargo.toml
--- a/D:/a/pore/pore/Cargo.toml
+++ b/D:/a/pore/pore/Cargo.toml
@@ -0,0 +0,0 @@
ERROR taplo:format_files: the file is not properly formatted path="D:/a/pore/pore/Cargo.toml"
diff a/D:/a/pore/pore/pore.toml b/D:/a/pore/pore/pore.toml
--- a/D:/a/pore/pore/pore.toml
+++ b/D:/a/pore/pore/pore.toml
@@ -0,0 +0,0 @@
ERROR taplo:format_files: the file is not properly formatted path="D:/a/pore/pore/pore.toml"
Seen in https://github.com/jmgao/pore/actions/runs/14044977210/job/39323643851. The same check on macOS and Ubuntu exits clean.
@tamird, I'm experiencing the same. It seems to be that taplo formats the toml file with LF line endings, while the original is with CRLF. Thus, it will always differ in whitespaces.
Have you tried crlf setting? https://taplo.tamasfe.dev/configuration/formatter-options.html
Have you tried
crlfsetting? https://taplo.tamasfe.dev/configuration/formatter-options.html
Tried this in a .taplo.toml file:
[formatting]
crlf = true
But still failing. Enabling verbose logging does not give any hints.
After some back and forth, I didn't noticed that taplo converted my files to LF first, thus continued failing. After transforming the .toml files from LF to CRLF, taplo run worked!
Thanks! This is indeed an improvement. Still, I think this should be automatic. For instance, git can be configured to checkout local but commit LF, which may cause pipelines to fail. Same for other CVS.
Would you consider this issue as a feature request to add automatic line-ending detection?