Very simply adds a git hook to your repository, which will format, lint and test your code, and will ask you to fix the problems before you commit.
bash cargo install cargo-hook cargo hook