From 003c251fdc14b3704a7ea8c7f6e68cdff734056a Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 13 Jan 2025 16:44:02 +0800 Subject: [PATCH] contrib: setup: Install and setup pre-commit --- contrib/setup | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/contrib/setup b/contrib/setup index 7eb1a84..b6cd50b 100755 --- a/contrib/setup +++ b/contrib/setup @@ -1,6 +1,21 @@ #!/usr/bin/env -S bash -e #set up local repository +install_pip() +{ + package=$1 + args=$2 + + python3 -m pip install $package $args +} + +setup_precommit() +{ + echo "Configuring pre-commit hooks" + install_pip pre-commit + pre-commit install +} + setup_git() { echo "Configuring git environment" @@ -8,3 +23,4 @@ setup_git() } setup_git +setup_precommit