New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added exclude-contributors and no-contributors-template configuration options #898
Added exclude-contributors and no-contributors-template configuration options #898
Conversation
Actually, I just realized that since I'm filtering values away, there's a chance the const sortedContributors = Array.from(contributors).sort()
if (sortedContributors.length > 1) {
return (
sortedContributors.slice(0, sortedContributors.length - 1).join(', ') +
' and ' +
sortedContributors.slice(-1)
)
} else {
return sortedContributors[0]
} I suppose it ought to be re-written into something like this: } else if (sortedContributors.length == 1) {
return sortedContributors[0]
} else {
// What here?
} but then, what of the remaining branch? Should I also add a new configuration option called something like |
I wrote the code for a |
could simply change it to the following } else if (sortedContributors.length == 1) {
return sortedContributors[0]
} The method does not require to return any value. |
Interesting. I suppose that's another piece of weirdness of JavaScript. In that case, it is certainly an option, but what will the result be if the function doesn't return anything? If it's an empty String, then I think I would still like to be able to customize the message. Consider the following
If all the contributors are filtered away, the release notes would contain the "Contributors" header, but nothing underneath it, which would look a little awkward. But if you wish, I can add your suggestion to this branch, and submit a separate pull request for a |
Perhaps move all the header, filtering and sorting together and simply check if length is zero after contributors are filtered than return before adding the header. Feel free to push to this PR otherwise you are making it hard for me to review |
Maybe we're misunderstanding one another, but I was talking about the
If a release is being made that only contains changes by Given the same changes by
I think these two options ( |
@ThomasKasene could you try and build with yarn to reduce the changes in dist folder?
|
@jetersen Absolutely! I'll take a look at it soon. Do you want me to undo the spacing on the "Configuration Options" table in README.md as well? My lines ended up being a bit long and so I decided to expand the "width" of the other rows as well, but I realize now that it might cause unnecessary merge conflicts. |
@ThomasKasene the linter will take care of it. |
Okay, nothing happened when I ran your suggested commands. I guess that means I either did it correctly by hand, or that the linter wasn't applied. Either way, dist/index.js got a little better now. |
Anyhow ended up doing it for ya |
As I mentioned in #569, I think it would be nice if we, as repository owners, would be able to remove ourselves from the list of contributors, so that we can more easily highlight 3rd party contributions.
I'm no JS developer myself and know precious little about Node, but I've made a best effort at adding a configuration option named
exclude-contributors
which removes specified usernames from the$CONTRIBUTORS
variable.I decided to not exclude the names that come from
commit.author.name
because if I understand the API correctly, they are not necessarily unique.PS: I'm not sure if I committed all the necessary files, so that's something that the reviewer should double-check. I'm also not sure if I set up my development environment properly; there was one test suite that failed, even before I started making my changes: