From 3cd15f34cd9ee33b55870a9ab6185bf74a76cedd Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Wed, 6 Nov 2024 16:39:26 -0700 Subject: [PATCH 1/2] style: Test install for commitizen --- .cz.toml | 7 +++++++ .pre-commit-config.yaml | 8 ++++++++ package-lock.json | 6 ++++++ package.json | 1 + 4 files changed, 22 insertions(+) create mode 100644 .cz.toml create mode 100644 .pre-commit-config.yaml create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..db8c69b --- /dev/null +++ b/.cz.toml @@ -0,0 +1,7 @@ +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_scheme = "semver" +version_provider = "cargo" +update_changelog_on_bump = true +major_version_zero = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9e64ac1 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- hooks: + - id: commitizen + - id: commitizen-branch + stages: + - push + repo: https://github.com/commitizen-tools/commitizen + rev: v3.30.0 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..4492723 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "managarr", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{} From 48ad17c6f19cbeee5f63d9cf7c2c99bf2eddea78 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Wed, 6 Nov 2024 16:48:27 -0700 Subject: [PATCH 2/2] style: Updated the contributing doc to also explain how to install commitizen --- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e64ac1..a66fe3a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,6 @@ repos: - id: commitizen - id: commitizen-branch stages: - - push + - pre-push repo: https://github.com/commitizen-tools/commitizen rev: v3.30.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d015793..a40d394 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,7 @@ # Contributing Contributors are very welcome! **No contribution is too small and all contributions are valued.** +## Rust You'll need to have the stable Rust toolchain installed in order to develop Managarr. The Rust toolchain (stable) can be installed via rustup using the following command: @@ -11,6 +12,37 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh This will install `rustup`, `rustc` and `cargo`. For more information, refer to the [official Rust installation documentation](https://www.rust-lang.org/tools/install). +## Commitizen +[Commitizen](https://github.com/commitizen-tools/commitizen?tab=readme-ov-file) is a nifty tool that helps us write better commit messages. It ensures that our +commits have a consistent style and makes it easier to generate CHANGELOGS. Additionally, +Commitizen is used to run pre-commit checks to enforce style constraints. + +To install `commitizen` and the `pre-commit` prerequisite, run the following command: + +```shell +python3 -m pip install commitizen pre-commit +``` + +### Commitizen Quick Guide +To see an example commit to get an idea for the Commitizen style, run: + +```shell +cz example +``` + +To see the allowed types of commits and their descriptions, run: + +```shell +cz info +``` + +If you'd like to create a commit using Commitizen with an interactive prompt to help you get +comfortable with the style, use: + +```shell +cz commit +``` + ## Setup workspace 1. Clone this repo