From 3e710ed46bf3d7305e296f6b6db368b418cba14e Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Sun, 27 Nov 2022 10:42:49 +0000 Subject: [PATCH] add .gitattributes rules for rust files Setting `diff=rust` will make git show the current function name in the hunk headers. While delta currently removes git's whitespace error markup from diffs adding the whitespace rules will mean pre-commit hooks that run `git diff --check` will reject changes with whitespace errors. The whitespace rule could perhaps be applied more widely but the Makefile and example gitcofig have leading tabs so I restricted them to rust files for now. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 7096c795b..8894d09dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.Makefile linguist-language=Makefile etc/performance/* linguist-vendored +*.rs diff=rust whitespace=tab-in-indent,trailing-space,space-before-tab eol=lf