ceremonyclient/crates/dkls23/.devtools/setup-githooks
Cassandra Heart 12996487c3
v2.1.0.18 (#508)
* experiment: reject bad peer info messages

* v2.1.0.18 preview

* add tagged sync

* Add missing hypergraph changes

* small tweaks to sync

* allow local sync, use it for provers with workers

* missing file

* resolve build error

* resolve sync issue, remove raw sync

* resolve deletion promotion bug

* resolve sync abstraction leak from tree deletion changes

* rearrange prover sync

* remove pruning from sync

* restore removed sync flag

* fix: sync, event stream deadlock, heuristic scoring of better shards

* resolve hanging shutdown + pubsub proxy issue

* further bugfixes: sync (restore old leaf sync), pubsub shutdown, merge events

* fix: clean up rust ffi, background coverage events, and sync tweaks

* fix: linking issue for channel, connectivity test aggression, sync regression, join tests

* fix: disjoint sync, improper application of filter

* resolve sync/reel/validation deadlock

* adjust sync to handle no leaf edge cases, multi-path segment traversal

* use simpler sync

* faster, simpler sync with some debug extras

* migration to recalculate

* don't use batch

* square up the roots

* fix nil pointer

* fix: seniority calculation, sync race condition, migration

* make sync dumber

* fix: tree deletion issue

* fix: missing seniority merge request canonical serialization

* address issues from previous commit test

* stale workers should be cleared

* remove missing gap check

* rearrange collect, reduce sync logging noise

* fix: the disjoint leaf/branch sync case

* nuclear option on sync failures

* v2.1.0.18, finalized
2026-02-08 23:51:51 -06:00

95 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
# Function to check if a command exists
check_command() {
if ! command -v "$1" &> /dev/null; then
echo "Error: $1 is not installed. Please install $1 and try again."
exit 1
fi
}
# Check if cargo and pnpm are installed and abort if some of them is not.
REQUIREMENTS=("cargo" "pnpm")
for REQUIERMENT in ${REQUIREMENTS[@]}; do
check_command $REQUIERMENT;
done
cargo install cargo-audit
cargo install cargo-unmaintained
# install husky and commitlint
pnpm add --save-dev husky @commitlint/{cli,config-conventional}
# init husky
pnpm exec husky init
# Create .commitlintrc
cat <<EOF > commitlint.config.js
module.exports = { extends: ['@commitlint/config-conventional'] };
EOF
# Create pre-commit hook
cat << 'EOF' > .husky/pre-commit
#!/bin/sh
# Run cargo fmt to format all files
cargo fmt
# Get a list of all staged files
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
# Re-stage any files that were modified by cargo fmt
for FILE in $STAGED_FILES; do
if [ -f "$FILE" ]; then
git add "$FILE"
fi
done
# Run clippy to ensure code quality
cargo clippy --all-targets
if [ $? -ne 0 ]; then
echo "clippy failed"
exit 1
fi
# Run cargo audit to check for vulnerabilities
cargo audit
if [ $? -ne 0 ]; then
echo "cargo audit found vulnerabilities"
exit 1
fi
# Run cargo unmaintained to check for unmaintained dependencies
cargo unmaintained
if [ $? -ne 0 ]; then
echo "cargo unmaintained found unmaintained dependencies"
exit 1
fi
# Run cargo test
cargo test
EOF
# Create commit-msg hook
cat <<EOF > .husky/commit-msg
#!/bin/sh
pnpm exec commitlint --edit "\$1"
EOF
# add executable permissions
chmod +x .husky/pre-commit
chmod +x .husky/commit-msg
# ignore locally
LOCAL_IGNORE_FILES=(
"package.json"
"pnpm-lock.yaml"
"commitlint.config.js"
"node_modules"
".husky"
)
for FILE in ${LOCAL_IGNORE_FILES[@]}; do
if ! grep -qF -- $FILE .git/info/exclude; then
echo $FILE >> .git/info/exclude
fi
done