-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
I've been toying around with the idea of creating Towncrier pre-commit hooks, one most importantly just checking that the news fragments are valid and then maybe also one to actually build the news from fragments if they hadn't already been applied.
So we'd just need to create a .pre-commit-hooks.yaml and set up with the appropriate defaults. I'm going to go ahead and create a PR, but I thought an issue might be a better place to discuss any objections or ideas.
Thinking of a .pre-commit-hooks.yaml like:
- id: towncrier-check
name: towncrier-check
description: Check Towncrier news updates
entry: towncrier --draft
pass_filenames: false
types: [text]
files: newsfragments/
language: python
- id: towncrier-update
name: towncrier-update
description: Update news with Towncrier
entry: towncrier
pass_filenames: false
args: ["--yes"]
files: newsfragments/
language: pythonAnd then in one of my project's cases were a use a different towncrier configuration, I'd implement my .pre-commit-config.yaml like:
repos:
- repo: https://github.com/twisted/towncrier
rev: trunk
hooks:
- id: towncrier-check
files: $changelog\.d/Thoughts and suggestions welcome 😄
Metadata
Metadata
Assignees
Labels
No labels