Skip to content

Commit

Permalink
style: enforce commit message format
Browse files Browse the repository at this point in the history
  • Loading branch information
dlstadther committed Jan 27, 2024
1 parent 24fbcfc commit 3b84500
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# .pre-commit-config.yaml
# see pyproject.toml for tool-specific configs

default_install_hook_types: [pre-commit, commit-msg]

repos:
# misc pre-commit helpers
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -46,3 +48,12 @@ repos:
hooks:
- id: sqlfluff-fix
- id: sqlfluff-lint

# commitlint
# (configuration in commitlint.config.js)
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
hooks:
- id: commitlint
additional_dependencies: ['@commitlint/config-conventional']
stages: [commit-msg]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ The checks contained in this repo include (in the order in which they run):
* `mypy` is used for static type checking
* `poetry` checks on valid and aligned pyproject.toml and poetry.lock files
* `sqlfluff` checks and fixes sql formatting and linting
* `commitlint` enforces commit message conforms to [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) format

If you want `ruff format` to ignore a particular section of code, you can add the comments `# fmt: off` and `# fmt: on` before and after the respective block of code (same as you would if using `black`).
* https://stackoverflow.com/a/58584557
Expand Down
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: [
"@commitlint/config-conventional"
],
}

0 comments on commit 3b84500

Please sign in to comment.