mirror of
https://github.com/google/ormolu.git
synced 2024-11-23 22:27:16 +03:00
Make sure we always get both original and formatted files
This commit is contained in:
parent
7a9aab77b3
commit
78e8dd830a
@ -74,7 +74,9 @@ $ nix-build -A hackage.<package>
|
||||
```
|
||||
|
||||
Then inspect `result/log.txt` for possible problems. The derivation will
|
||||
also contain formatted files for inspection.
|
||||
also contain formatted `.hs` files for inspection and original inputs with
|
||||
`.hs-original` extension (those are with CPP dropped, exactly what is fed
|
||||
into Ormolu).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir "$out"
|
||||
find . -name '*.hs-original' -exec cp --parents {} $out \;
|
||||
find . -name '*.hs' -exec cp --parents {} $out \;
|
||||
cp log.txt $out/log.txt
|
||||
'';
|
||||
|
@ -14,5 +14,8 @@ cpphs "$1" --noline > "$1-nocpp" 2> /dev/null
|
||||
# annoyingly, cpphs cannot modify files in place
|
||||
mv "$1-nocpp" "$1"
|
||||
|
||||
# preserve the original
|
||||
cp "$1" "$1-original"
|
||||
|
||||
# run ormolu
|
||||
ormolu -m inplace "$1"
|
||||
ormolu -m inplace "$1" || ormolu -u -m inplace "$1"
|
||||
|
Loading…
Reference in New Issue
Block a user