Skip to content

Instantly share code, notes, and snippets.

@thiamsantos
Created March 20, 2019 23:42
Show Gist options
  • Save thiamsantos/69337f98c20f399a31f7b6235033c402 to your computer and use it in GitHub Desktop.
Save thiamsantos/69337f98c20f399a31f7b6235033c402 to your computer and use it in GitHub Desktop.
Precommit format
#!/bin/bash
for file in $(git diff --name-only --staged | sort | uniq | grep ".exs\?")
do
mix format $file
git add $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment