diff --git a/tools/pre-commit b/tools/pre-commit index 3f9e5b43..7721b4cb 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -1,8 +1,13 @@ #!/bin/bash -# Copyright (c) 2022 Xu Shaohua . All rights reserved. +# Copyright (c) 2024 Xu Shaohua . All rights reserved. # Use of this source is governed by General Public License that can be found # in the LICENSE file. # Make sure each commit is linted +# Install this script to `.git/hooks/pre-commit` -cargo clippy +set -xe + +cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged + +cargo fmt --all