File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -321,15 +321,36 @@ fn run_update() -> Result<(), Box<dyn std::error::Error>> {
321321}
322322
323323fn run_check ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
324+ // On Windows, `cargo sort --check` fails since it default to LF, not CRLF,
325+ // line endings. Work around this by changing this setting only on Windows.
326+ // See the
327+ // [cargo sort config docs](https://github.com/DevinR528/cargo-sort?tab=readme-ov-file#config)
328+ // and the
329+ // [related issue](https://github.com/DevinR528/cargo-sort/issues/85).
330+ //
331+ // However, this still fails: `cargo sort` uses
332+ // [inconsistent line endings](https://github.com/DevinR528/cargo-sort/issues/86).
333+ /***
334+ #[cfg(windows)]
335+ {
336+ fs::write("tomlfmt.toml", "crlf = true")
337+ .map_err(|err| -> String { format!("Unable to write tomlfmt.toml: {err}") })?;
338+ }
339+ */
324340 // The `-D warnings` flag causes clippy to return a non-zero exit status if
325341 // it issues warnings.
326342 run_cmd ! (
327343 cargo clippy --all-targets -- -D warnings;
328344 cargo fmt --check;
345+ cargo clippy --all-targets --manifest-path=../builder/Cargo . toml -- -D warnings;
346+ cargo fmt --check --manifest-path=../builder/Cargo . toml;
347+ ) ?;
348+ // `cargo sort` produces false positives under Windows. Ignore for now. See
349+ // the above comments. It also doesn't support the
350+ #[ cfg( not( windows) ) ]
351+ run_cmd ! (
329352 cargo sort --check;
330353 cd ../builder;
331- cargo clippy --all-targets -- -D warnings;
332- cargo fmt --check;
333354 cargo sort --check;
334355 ) ?;
335356 run_build ( ) ?;
You can’t perform that action at this time.
0 commit comments