Last active
January 4, 2022 23:54
-
-
Save Gabriella439/a4a9bd3fcd9d1256ce4d6ddc42db1619 to your computer and use it in GitHub Desktop.
Files related to Haskell code formatting livestream
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
steps: | |
- module_header: | |
open_bracket: next_line | |
separate_lists: false | |
sort: false | |
- imports: | |
align: group | |
pad_module_names: false | |
long_list_align: new_line_multiline | |
separate_lists: false | |
- language_pragmas: | |
align: true |
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
IFS=$'\n' FILES=( $(git diff --name-only --cached | grep '\.hs$' ) ) | |
if [ "${#FILES[@]}" -ne 0 ]; then | |
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.haskellPackages.fourmolu -- --mode inplace "${FILES[@]}" | |
git add "${FILES[@]}" | |
fi |
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
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.haskellPackages.fourmolu -- --mode inplace $(find . -name '*.hs') |
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
indentation: 4 | |
comma-style: leading | |
record-brace-space: false | |
indent-wheres: false | |
diff-friendly-import-export: false | |
haddock-style: multi-line | |
respectful: true | |
newlines-between-decls: 1 |
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
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.ormolu -- --mode inplace $(find . -name '*.hs') |
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
#!/bin/sh | |
git update-index --again |
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
#!/bin/sh | |
./format.sh | |
if git diff --cached --exit-code --quiet; then | |
git update-index --again | |
exit 1 | |
fi |
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
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.stylish-haskell -- --inplace $(find . -name '*.hs') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment