diff --git a/.github/workflows/pre_commit_check.yml b/.github/workflows/pre_commit_check.yml index c609c54d6..a2dcb5421 100644 --- a/.github/workflows/pre_commit_check.yml +++ b/.github/workflows/pre_commit_check.yml @@ -26,6 +26,7 @@ jobs: run: | pip install pre-commit pre-commit install-hooks + pre-commit install --hook-type commit-msg --hook-type pre-push - name: Run pre-commit and check for any changes run: | echo "Commits being checked:" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1296a0a7a..3def3ffa7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,3 +50,9 @@ repos: hooks: - id: astyle_py args: ['--style=otbs', '--attach-namespaces', '--attach-classes', '--indent=spaces=4', '--convert-tabs', '--align-pointer=name', '--align-reference=name', '--keep-one-line-statements', '--pad-header', '--pad-oper'] + - repo: https://github.com/commitizen-tools/commitizen + rev: v2.42.1 + hooks: + - id: commitizen + - id: commitizen-branch + stages: [push] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed310bc4c..0a0c3387c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,8 +6,10 @@ Contributions in the form of pull requests, issue reports, and feature requests - [ ] Fork the [esp-protocols repository on GitHub](https://github.com/espressif/esp-protocols) to start making your changes. -- [ ] Install pre-commit hooks: `pip install pre-commit && pre-commit install` +- [ ] Install pre-commit hooks: `pip install pre-commit && pre-commit install-hooks && pre-commit install --hook-type commit-msg --hook-type pre-push` - [ ] Send a pull request (PR) and work with us until it gets merged and published. Contributions may need some modifications, so a few rounds of review and fixing may be necessary. For quick merging, the contribution should be short, and concentrated on a single feature or topic. The larger the contribution is, the longer it would take to review it and merge it. + +Please follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) rule when writing commit messages.