From 4e27cd0719bee8c3151434feda7ed4a2617ebd55 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 6 Apr 2024 17:47:30 +0100 Subject: [PATCH] chore: add cc-cli support for conventional commits --- .git-hooks/prepare-commit-msg | 4 ++++ .gitignore | 3 +++ Cargo.toml | 6 ++++++ justfile | 3 +++ 4 files changed, 16 insertions(+) create mode 100755 .git-hooks/prepare-commit-msg create mode 100644 justfile diff --git a/.git-hooks/prepare-commit-msg b/.git-hooks/prepare-commit-msg new file mode 100755 index 00000000..e55efe12 --- /dev/null +++ b/.git-hooks/prepare-commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +# cc-cli as a commit hook +exec < /dev/tty +cargo bin cc-cli "$@" diff --git a/.gitignore b/.gitignore index 3ca43aec..ac3080b4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ debug/ target/ +# cargo-bin-run cache +.bin + # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index d25f581f..de25a3e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +[dev-dependencies] +cc-cli = "0.1.5" + +[package.metadata.bin] +cc-cli = { version = "0.1" } diff --git a/justfile b/justfile new file mode 100644 index 00000000..ad640d94 --- /dev/null +++ b/justfile @@ -0,0 +1,3 @@ +install-hooks: + @echo "Installing git hooks" + git config core.hooksPath .git-hooks