diff --git a/checks/cleanCargoTomlTests/default.nix b/checks/cleanCargoTomlTests/default.nix index a8e92469..ade31c0b 100644 --- a/checks/cleanCargoTomlTests/default.nix +++ b/checks/cleanCargoTomlTests/default.nix @@ -3,7 +3,6 @@ filters, lib, linkFarmFromDrvs, - remarshal, runCommand, writeTOML, }: @@ -22,11 +21,7 @@ let if lib.pathExists expectedPathSpecific then expectedPathSpecific else path + "/expected.toml"; in runCommand "compare-${folderName}-${filterName}" { } '' - function reformat { - ${remarshal}/bin/remarshal --sort-keys -i "$1" --of toml - } - - diff <(reformat ${expected}) <(reformat ${cleanedToml}) + diff ${expected} ${cleanedToml} touch $out ''; cmpAllFilters = diff --git a/checks/mkDummySrcTests/default.nix b/checks/mkDummySrcTests/default.nix index 59932f39..e0f0bfaf 100644 --- a/checks/mkDummySrcTests/default.nix +++ b/checks/mkDummySrcTests/default.nix @@ -2,7 +2,6 @@ lib, linkFarmFromDrvs, mkDummySrc, - remarshal, runCommand, writeText, }: @@ -18,15 +17,6 @@ let in runCommand "compare-${name}" { } '' echo ${expected} ${actual} - cp -r --no-preserve=ownership,mode ${expected} ./expected - cp -r --no-preserve=ownership,mode ${actual} ./actual - - find ./expected ./actual \ - -name Cargo.toml \ - -exec mv '{}' '{}.bak' \; \ - -exec ${remarshal}/bin/remarshal --sort-keys --if toml -i '{}.bak' --of toml -o '{}' \; - find ./expected ./actual -name Cargo.toml.bak -delete - diff -r ./expected ./actual touch $out ''; diff --git a/lib/writeTOML.nix b/lib/writeTOML.nix index 04c07949..87586487 100644 --- a/lib/writeTOML.nix +++ b/lib/writeTOML.nix @@ -4,7 +4,7 @@ let inherit (pkgsBuildBuild) - remarshal + yj runCommand ; in @@ -13,8 +13,8 @@ runCommand name { contents = builtins.toJSON contents; passAsFile = [ "contents" ]; - nativeBuildInputs = [ remarshal ]; + nativeBuildInputs = [ yj ]; } '' - remarshal -i $contentsPath -if json -of toml -o $out + cat $contentsPath | yj -jt > $out ''