Skip to content

Instantly share code, notes, and snippets.

@Gabriella439
Last active January 4, 2022 23:54
Show Gist options
  • Save Gabriella439/a4a9bd3fcd9d1256ce4d6ddc42db1619 to your computer and use it in GitHub Desktop.
Save Gabriella439/a4a9bd3fcd9d1256ce4d6ddc42db1619 to your computer and use it in GitHub Desktop.
Files related to Haskell code formatting livestream
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
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
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.haskellPackages.fourmolu -- --mode inplace $(find . -name '*.hs')
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
nix run github:NixOS/nixpkgs/release-21.11#legacyPackages.x86_64-darwin.ormolu -- --mode inplace $(find . -name '*.hs')
#!/bin/sh
git update-index --again
#!/bin/sh
./format.sh
if git diff --cached --exit-code --quiet; then
git update-index --again
exit 1
fi
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