Skip to content

Instantly share code, notes, and snippets.

@Fishrock123
Created December 6, 2021 23:20
Show Gist options
  • Select an option

  • Save Fishrock123/058461e1f0bc5ad7bd309a7dd259e8d7 to your computer and use it in GitHub Desktop.

Select an option

Save Fishrock123/058461e1f0bc5ad7bd309a7dd259e8d7 to your computer and use it in GitHub Desktop.

Revisions

  1. Fishrock123 created this gist Dec 6, 2021.
    6 changes: 6 additions & 0 deletions pre-commit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/sh
    set -e
    for file in $(git diff --name-only --cached --diff-filter=d | grep '\.rs$'); do
    rustfmt --edition 2021 $file # this will NEVER age poorly
    git add "$file"
    done