Add doNotThank option to @changeset/changelog-github#460
Conversation
|
Hooray! All contributors have signed the CLA. |
💥 No ChangesetLatest commit: 99353b3 Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂 If these changes should be published to npm, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Andarist
left a comment
There was a problem hiding this comment.
I'm not sure if we'd like to proceed with this one, what are the benefits? What problems are caused by thanking all people? 🤔
| }); | ||
| return `\n\n- ${links.commit}${ | ||
| links.pull === null ? "" : ` ${links.pull}` | ||
| links.pull == null ? "" : ` ${links.pull}` |
There was a problem hiding this comment.
IMHO would be better to keep strong comparisons here - ===
There was a problem hiding this comment.
Using strong comparisons on null is actually less safe, since using a weak one will catch both null and undefined, which you most often want to do.
There was a problem hiding this comment.
I understand the difference - can undefined be even received here though?
There was a problem hiding this comment.
I don't know, but it's good practice to always use the weak one since it catches more potential branches with no downsides, so I did it here. 🤷
| } | ||
|
|
||
| const shouldThank = (user: string) => { | ||
| // Handle an array of names to not thank |
There was a problem hiding this comment.
those comments here don't seem super useful - the code is rather simple and handles its job quite literally, so this seems repetitive for me
There was a problem hiding this comment.
I added them since there is no documentation for the option yet, so if someone goes into the code they will see it quickly without having to read the code.
Speaking of documentation, where should that be added?
There was a problem hiding this comment.
Let's first discuss the merit of this option - don't want you to put too much work into this one if we decide not to proceed with this one in the end (I'm not saying that we won't, yet).
|
The main issues I see occurring is for example if you're the sole developer on a project. It's very nice to get links to the PRs and commits in the changelog, but seeing The other situation I've encountered is at work, where we don't really need to be thanking all the people working on the project, so it feels out of place |
|
Isn't usually more information considered to be better than a lack of information? Those really seem quite harmless to me, even if a little bit excessive at times. You could rely on those to ask authors question regarding certain changes, rather than looking through |
|
If you like it or use it you can just not disable it, it's an option and not forced on you. 😄 For example I realised that it's good that the PR authors get pinged on the release PR so they know it exists, so we're probably gonna keep it at work - but I still don't want it to endlessly thank myself on any personal projects I might use changelog-github for |
|
@beeequeue Thanks for the PR! I'd probably actually recommend making your own functions, rather than using one of our defaults. Our goal was to make writing new generation functions easy and letting the community build lots to suit their needs, rather than having 1 or 2 canon ones that have a bunch of configuration options. I thoroughly acknowledge that writing new changelog generators is not where we want it to be at the moment though. I'd be more interested in this as its own package than as an option for the existing one. |
|
It feels very overkill to copy-paste a whole generator, etc. just to add an option, but if that's what you prefer I'll do that instead. 😕 |
|
You probably could reuse our implementation and just strip away what u want with by manipulating the returned string. We have to balance lean API and community demands, lean API doesnt only mean fewer options but also, more importantly, it means a reduced complexity of our implementation. If we add everything that is being asked for we’d end up with unmanageable code. If this issue arise again in the future we might reconsider stance on this particular option but for now i think it’s not needed as it has only been requested by you, so we cant really classify it as a popular demand. |
Takes a boolean (to disable thanking) or an array of names (to exclude them from being thanked).
Useful for if thanking people in the changelog is not necessary, e.g. thanking the main developer/maintainer over and over again, or in a private repo for work.
Was written directly on GitHub so might have style problems and has not been tested yet