twisted / towncrier

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

allow specifying fragment types to consider as "valid" for `towncrier check` #617

Closed bentheiii closed 2 days ago

bentheiii commented 1 week ago

Hello, it would be helpful to us to be able to specify within towncrier check which fragment types it should look for or not look for.

Background on why this would be useful: We have automatic processes that create a newsfragment of a special type (dependency_bump) whenever a version of one of dependency libraries is updated. Even though these are real changes that we'd like to be noted in the changelog, we'd like towncrier check to assert that there are real human-readable newsfragments that explain the actual change, if any.

I propose an additional, optional key to configured sections ([[tool.towncrier.type]]): ignore_on_check. if this key is configured to True, towncrier check will ignore all newsfragments of this type

adiroiban commented 1 week ago

Hi Ben.

Thanks for the report.

I don't think I understand what is the request here. Sorry.

Can you please give a step by step example with the current behaviour/result of towncrier vs the expected behaviour / expected result ?

Cheers

bentheiii commented 1 week ago

Hi Adi.

What I want is for towncrier check, which checks for new newsfragments (and exits with an error if none are found), to ignore newsfragemnts of certain types. So for example, if our pyproject.toml looks like this:

...
[[tool.towncrier.type]]
directory = "feature"
name = "Features"

[[tool.towncrier.type]]
directory = "dbump"
name = "Dependency Bumps"
ignore_on_check = true  # <-- the new flag propose to add
...

Then towncrier check will only pass if there are newsfragments of a non-dbump type

Also, I realized that the original issue incorrectly referenced the [[tool.towncrier.section]], I edited it to be correct

adiroiban commented 1 week ago

Let me see if I got this right.

For example you have a branch called 313-update-cryptography

And on that branch you might have the following newsfragments

So with with just newsfragments/313.dump on the branch, towncrier check should fail.

Is that correct ?

Feel free to send a PR.

As long as the PR has documentation and automated tests, we can have it merged.

bentheiii commented 1 week ago

Yes, that's right, I will work on a PR