From 551582832049c6f13cd1aff692063b08f7c82a9e Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 4 Jun 2025 07:55:45 -0700 Subject: [PATCH 1/2] ci: initial tox setup and environment to run commitizen Move to using: https://commitizen-tools.github.io/commitizen/ This will enable us to automate our Changelogs when we do releases. Use tox to setup and run commitizen: https://tox.wiki/ A follow on commit will set this up to run in a GitHub action workflow. --- requirements-lint.txt | 1 + tox.ini | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 requirements-lint.txt create mode 100644 tox.ini diff --git a/requirements-lint.txt b/requirements-lint.txt new file mode 100644 index 000000000..d23808906 --- /dev/null +++ b/requirements-lint.txt @@ -0,0 +1 @@ +commitizen==4.4.1 diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..2cf4efcb4 --- /dev/null +++ b/tox.ini @@ -0,0 +1,34 @@ +[tox] +minversion = 4.0 +skipsdist = True +skip_missing_interpreters = True +envlist = cz + +[testenv] +passenv = + DOCKER_HOST + FORCE_COLOR + GITHUB_ACTIONS + GITHUB_WORKSPACE + NO_COLOR + PWD +setenv = + DOCS_SOURCE = docs/source + DOCS_BUILD = docs/build/html + VIRTUAL_ENV={envdir} +whitelist_externals = true +usedevelop = True +install_command = pip install {opts} {packages} +isolated_build = True + +[testenv:cz] +basepython = python3 +deps = -r{toxinidir}/requirements-lint.txt +commands = + cz check --rev-range XXXXXX..HEAD + +# TODO: Setup new docs system +# [testenv:docs] +# description = Builds the docs site. Generated HTML files will be available in '{env:DOCS_BUILD}'. +# deps = -r{toxinidir}/requirements-docs.txt +# commands = sphinx-build -n -W --keep-going -b html {env:DOCS_SOURCE} {env:DOCS_BUILD} From 5fdbdcbe48cb331a6cc39ed587ce61f45eb425d0 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 4 Jun 2025 08:14:20 -0700 Subject: [PATCH 2/2] ci: enable commitizen check and add info to CONTRIBUTING.md * Enable the commitizen check * Update CONTRIBUTING.md with info on conventional commits format --- .github/workflows/lint-and-analyse-php.yml | 13 +++ CONTRIBUTING.md | 117 +++++++++++++++++++++ tox.ini | 2 +- 3 files changed, 131 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-analyse-php.yml b/.github/workflows/lint-and-analyse-php.yml index defd7f7e0..87083ec8e 100644 --- a/.github/workflows/lint-and-analyse-php.yml +++ b/.github/workflows/lint-and-analyse-php.yml @@ -17,6 +17,19 @@ permissions: contents: read jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5.4.0 + with: + python-version: "3.13" + - run: pip install --upgrade tox + - name: Run commitizen (https://commitizen-tools.github.io/commitizen/) + run: tox -e cz + markdownlint: runs-on: ubuntu-latest steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9c048c5b..b1516b152 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,3 +86,120 @@ We'd love to hear your ideas for improving LibreBooking. 4. Your PR will be reviewed by maintainers. We aim to review PRs in a timely manner, but please be patient. 5. Address any feedback or requested changes. 6. Once your PR is approved and CI checks pass, it will be merged. Thank you for your contribution. + +## Commit Message Guidelines + +We have precise rules over how our git commit messages should be formatted. +This leads to more readable messages that are easy to follow when looking +through the project history. This also enables us to automate our Changelog +generation at release time. + +### Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The +header has a special format that includes a **type**, a **scope** and a +**subject**: + +```text +(): + + + +