Skip to content

Commit

Permalink
🧪📝 Make changelog validation pre-commit native
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Dec 10, 2023
1 parent a6fad73 commit 1b168db
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 51 deletions.
51 changes: 44 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
---

repos:
- repo: local
hooks:
- id: check-changes
name: Check CHANGES
language: system
entry: ./tools/check_changes.py
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
hooks:
Expand Down Expand Up @@ -87,6 +80,50 @@ repos:
exclude: >-
^CHANGES\.rst$
- repo: local
hooks:
- id: changelogs-rst
name: changelog filenames
language: fail
entry: >-
Changelog files must be named
####.(
bugfix
| feature
| deprecation
| breaking
| doc
| packaging
| contrib
| misc
)(.#)?(.rst)?
exclude: >-
(?x)
^
docs/changelog-fragments/(
\.gitignore
|\d+\.(
bugfix
|feature
|deprecation
|breaking
|doc
|packaging
|contrib
|misc
)(\.\d+)?(\.rst)?
|README\.rst
|\.TEMPLATE\.j2
)
$
files: ^CHANGES/
- id: changelogs-user-role
name: Changelog files should use a non-broken :user:`name` role
language: pygrep
entry: :user:([^`]+`?|`[^`]+[\s,])
pass_filenames: true
types: [file, rst]

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.7.1
hooks:
Expand Down
44 changes: 0 additions & 44 deletions tools/check_changes.py

This file was deleted.

0 comments on commit 1b168db

Please sign in to comment.