twisted / towncrier

Manage the release notes for your project.
https://towncrier.readthedocs.io
MIT License
755 stars 107 forks source link

Add support for $NEXT_RELEASE$ source code placeholder / keyword substitution #579

Open adiroiban opened 3 months ago

adiroiban commented 3 months ago

This is designed as the next step after removing incremental.

Incremental has a nice feature that allowes to replace the NEXT placeholder in the source code, with the value of the current release number.

This is similar to keywords substitution from CVS but the use case is a different.


The use case is something like this:

During development you add various features in various branches. When you first implement a change or when you send to review, you don't know the exact version number in which that feature is released.

Any text reference to the version number is replaced at development time with the $NEXT_VERSION$

The branch and merged with source code including the $NEXT_VERSION$ text.

At release time, you run towncrier and towncrier will replace the source code with the actual release number.


I think that it makes sense to have this functionality in towncrier

When you run towncrier, it will delele the release notes fragments ... so it is already modifying the source code.

Also, when you run towncrier it knows the current release version.

The placeholder can also be $NEXT_RELEASE$ or $NEXT_TOWNCRIER_RELEASE$ or something else. The important part is to make sure it will not overlap with other texts in the source code.

This should be a very simple text replacement. In this way, you can use the value in Python, RST, JavaScript or any other text file.