Last active
August 12, 2019 23:23
-
-
Save utdemir/a28a45739819a65a52983f7701a4554b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ old, new, pkgs ? import <nixpkgs> {}}: | |
let | |
packages = [ | |
"aeson" "Agda" "attoparsec" "cassava" "conduit" "cryptonite" | |
"diagrams-core" "distributed-process" "esqueleto" "git-annex" "hakyll" | |
"hedgehog" "hlint" "http-client" "idris" "lens" "pandoc" "pipes" | |
"purescript" "QuickCheck" "servant" "servant-server" "ShellCheck" | |
"singletons" "tls" | |
]; | |
ormoluOld = import old; | |
ormoluNew = import new; | |
in | |
pkgs.runCommand "ormolu-batch" {} '' | |
printf "%20s %5s %5s %8s\n" name old new result >> $out | |
${pkgs.lib.concatMapStringsSep | |
"\n" | |
(n: '' | |
name=${n} | |
old=$(wc -l "${ormoluOld.hackage.${n}}/log.txt" | cut -f 1 -d ' ') | |
new=$(wc -l "${ormoluNew.hackage.${n}}/log.txt" | cut -f 1 -d ' ') | |
if [ "$new" -eq 0 ] && [ "$old" -gt 0 ]; then | |
res="perfect" | |
elif [ "$new" -lt "$old" ]; then | |
res="better" | |
elif [ "$new" -gt "$old" ]; then | |
res="worse" | |
else | |
res="same" | |
fi | |
printf "%20s %5s %5s %8s\n" $name $old $new $res >> $out | |
'') | |
packages | |
} | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment