Skip to content

Commit

Permalink
add .gitattributes rules for rust files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phillipwood committed Nov 27, 2022
1 parent afa7a1a commit 3e710ed
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3e710ed

Please sign in to comment.