8 git add clippy_lints/src/lib.rs
9 git add clippy_lints/src/lib.*.rs
12 # Git will not automatically add the formatted code to the staged changes once
13 # fmt was executed. This collects all staged files rs files that are currently staged.
14 # They will later be added back.
16 # This was proudly stolen and adjusted from here:
17 # https://medium.com/@harshitbangar/automatic-code-formatting-with-git-66c3c5c26798
18 files=$( (git diff --cached --name-only --diff-filter=ACMR | grep -Ei "\.rs$") || true)
19 if [ ! -z "${files}" ]; then
21 git add $(echo "$files" | paste -s -d " " -)