twisted / towncrier

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

Pre-commit hook suggestions #604

Open SmileyChris opened 1 month ago

SmileyChris commented 1 month ago

Description

As discussed in #600, here are my suggestions on the pre-commit changes.

adiroiban commented 1 month ago

Thanks for the PR.

I have never used to pre-commit hooks for my projects.

I have custom GitHub actions steps to call towncrier as part of a PR branch protection checks and I always do both check and draft.

And draft is piped to GitHub Action summary , for easy review... just like we have for towncrier itself

https://github.com/twisted/towncrier/actions/runs/9216320582#summary-25356369369

I am -1 for having a separate hook for check and draft

Don't worry to much. As I mentioned, I am not using pre-commit hooks... so I don't care too much.

But I think that it would help to get feedback for more people. So maybe, just as a review to @twisted/towncrier-contributors


My only important comment is about backward compatibility.

I see the test pass. So the change should be ok.

I think that for backward compatibility testing, it's important to keep this check, pinned at the current version

https://github.com/twisted/towncrier/blob/15d1e25d9dc676cd85fe1488341b272f6bb0e836/.pre-commit-config.yaml#L37-L40


I guess that this PR will update .pre-commit-config.yaml to add the news hooks.


I have never used towncrier-update .

Does this hook make sense ?

SmileyChris commented 1 month ago

Personally I think the only sensible hook is one that does the equivalent of towncrier check. It makes sense to have a pre-merge git hook to check for the presence of a news fragment.

My suggestions here were to add that one, but keep the others and just better document them (and have more sensible naming and better defaults). The only other related change that may make sense is keeping towncrier-check around and just have it raise a deprecation warning.

If we think there's no use to them, I'm fine "burning the chaff" too.

adiroiban commented 1 month ago

It ok to have them. No problem.

I am not a big user of pre-commit , so anything is ok for me.

I am not -1.

We can have this PR in review for one week, and if you are happy with the hooks and nobody is agains the changes, we can merge it.

Thanks