diffplug / spotless-changelog

The changelog is cast, let the versions fall where they may.
Apache License 2.0
45 stars 2 forks source link

Allow the version token to be a link #21

Open FRodrigues-BrandenPT opened 3 years ago

FRodrigues-BrandenPT commented 3 years ago

Hello, In my project instead of using a simple [1.0.0] - 2021-04-06 we use [1.0.0](#100---2021-04-06) - 2021-04-06 (to quickly focus on the paragraph version and to be more pretty). But because you only check for "] - " to end the parsing of the version then in my changelogs the changelogCheck is going to always throw the error below:

https://github.com/diffplug/spotless-changelog/blob/3b773c36024815f8dc4c07e753dee8ba482f6a51/spotless-changelog-lib/src/main/java/com/diffplug/spotless/changelog/Changelog.java#L252-L257

What do you think?

nedtwigg commented 3 years ago

Right now the model is this:

In order to work, spotless-changelog needs to parse a changelog and modify it. So to handle your case, we need to:

https://github.com/diffplug/spotless-changelog/blob/3b773c36024815f8dc4c07e753dee8ba482f6a51/spotless-changelog-lib/src/main/java/com/diffplug/spotless/changelog/Changelog.java#L286-L295

One of the simple features we have already is that you can replace the versionSchema function. It would also be easy to replace the headerMisc with a specific computed value (link to javadoc, usage stats, etc.)

I think it would reasonable to do something like this:

I would be happy to merge a PR along these lines. However, I insist that the PR author starts by writing the documentation first, and getting a round of feedback on that part. Adding this versionLink feature, imo, is useful but not very useful. So if it doubles the complexity for users who are okay with the standard keepachangelog format, then it's not worth it. The burden on making this flexibility unobtrusive is on the PR author, but I am confident it can be done.

FRodrigues-BrandenPT commented 3 years ago

Thank you for your reply.

Now I'm occupied with another project. When I get spare time I'm going to see what I can do.