mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 04:54:16 +00:00
feat: add conventional commit check
This commit is contained in:
parent
aae27b8a3e
commit
51be90a152
2 changed files with 17 additions and 0 deletions
|
|
@ -95,6 +95,17 @@
|
||||||
entry: check-yaml
|
entry: check-yaml
|
||||||
language: python
|
language: python
|
||||||
types: [yaml]
|
types: [yaml]
|
||||||
|
|
||||||
|
- id: conventional-commit-msg
|
||||||
|
name: conventional commit message
|
||||||
|
# type(scope)?: description (body)? (footer)? (lowercase, present tense, and no period at the end)
|
||||||
|
language: pygrep
|
||||||
|
entry: '^(chore|test|feat|fix|build|docs|refactor)!?(\([a-z]+\))?: (?![A-Z][a-z])(?![a-z]+(ed|ing)\s).*$'
|
||||||
|
args:
|
||||||
|
- --multiline
|
||||||
|
- --negate # fails if the entry is NOT matched
|
||||||
|
stages: [commit-msg]
|
||||||
|
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
name: debug statements (python)
|
name: debug statements (python)
|
||||||
description: checks for debugger imports and py37+ `breakpoint()` calls in python source.
|
description: checks for debugger imports and py37+ `breakpoint()` calls in python source.
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,12 @@ Attempts to load all yaml files to verify syntax.
|
||||||
portability to other yaml implementations.
|
portability to other yaml implementations.
|
||||||
Implies `--allow-multiple-documents`.
|
Implies `--allow-multiple-documents`.
|
||||||
|
|
||||||
|
#### `conventional-commit-msg`
|
||||||
|
Check if the top line of a commit message follows the
|
||||||
|
[conventional rules](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||||
|
The message is expected in format: `type(scope)?: description (body)? (footer)?`
|
||||||
|
Where description is in lowercase, present tense, and no period at the end.
|
||||||
|
|
||||||
#### `debug-statements`
|
#### `debug-statements`
|
||||||
Check for debugger imports and py37+ `breakpoint()` calls in python source.
|
Check for debugger imports and py37+ `breakpoint()` calls in python source.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue