Skip to content

Commit

Permalink
add towncrier
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Jul 4, 2024
1 parent 79cbe21 commit d9a8af0
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ repos:
- id: doc8
description: This hook runs doc8 for linting docs
require_serial: true

- repo: local
hooks:
- id: changelog-fragment-filenames
name: changelog fragment
language: fail
entry: changelog fragment files must be named *.(breaking|change|provider|refiner|deprecation|doc|misc).rst
exclude: ^changelog.d/(\..*|towncrier_template.rst|.*\.(breaking|change|provider|refiner|deprecation|doc|misc).rst)
files: ^changelog.d/
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog
---------

.. towncrier release notes start
2.2.1
^^^^^
**release date:** 2024-06-27
Expand Down
1 change: 1 addition & 0 deletions changelog.d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ docs = [
"sphinx",
"sphinx_rtd_theme",
"sphinxcontrib-programoutput",
"towncrier",
]
test = [
"mypy",
Expand Down Expand Up @@ -213,6 +214,52 @@ source = ["subliminal"]
relative_files = true


# https://towncrier.readthedocs.io/en/stable/tutorial.html
[tool.towncrier]
name = "subliminal"
package = "subliminal"
directory = "changelog.d"
filename = "HISTORY.rst"
title_format = "`version <https://github.com/Diaoul/subliminal/tree/{version}>`_ - {project_date}"
issue_format = "`#{issue} <https://github.com/Diaoul/subliminal/issues/{issue}>`_"
underlines = ["^", "-", "~"]

[[tool.towncrier.type]]
directory = "breaking"
name = "Backwards-incompatible Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "provider"
name = "Provider Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "refiner"
name = "Refiner Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
name = "Documentation"
showcontent = false

[[tool.towncrier.type]]
directory = "misc"
name = "Misc"
showcontent = false


# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "subliminal/**/*.py"
Expand Down

0 comments on commit d9a8af0

Please sign in to comment.