geut / chan

A Changelog CLI based on http://keepachangelog.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support custom sections

lud opened this issue · comments

A coworker of mine added the following sub section in the Unreleased section:

### New environment variables

bla bla bla bla bla bla

Whenever I tried to run a command, the command would fail with:

The name prop to create an action is not valid

Would it be possible to accept sections that are not know to the tool, and blindly copy them when releasing?

Thank you

commented

Hi @lud 👋

This sounds like a good feature. From the top of my head this sounds like adding a new command, we will need a way to kind of "register" the new section so you can use it later, like with any other command.

Ideally something like:

chan register mySection
chan mySection 'new feature description'

In the meantime, we are looking to learn more from our users, maybe you can help with this: #71

While custom "managed" sections seems a very good feature, I was more thinking about « take whatever is in the markdown and is not recognized as a know section and keep it as it is ».

That would support some informative sections that will appear once or twice at most, like « Changed Hosting Service », « New team is on board », « Outsourced some part of the project », « Rewrote some subsystem in Rust », etc.

Those are not great examples for the purpose of a changelog I reckon, but I hope you see what I mean.

commented

My colleague, @tinchoz49, brought something to my attention. If we let new sections to be part of the changelog, then we will breaking compatibility with keep-a-changelog format. This is just slight difference, a detail, but he is right.

And of course, the same applies if we allow new tags by scanning an existing changelog file.

I understand the main value should be to communicate clearly the evolution of a project. Keep that timeline clear and readable is quite important.
Maybe adding some kind of release notes in companion with a well maintained CHANGELOG.md would allow you to add more info to every new every release. I also understand that this is not suitable for your situation where a CHANGELOG file already exists. Of course, you can manually edit it and adjust it to be keep-a-changelog compatible but again I think this is not an optimal solution.

I think that the keepachangelog format is pretty loose, but you are right that if anything is allowed in a version section, or in the unreleased section that will break tools that parse the changelogs.

So yeah, I guess all that different paragraphs could be grouped as items under a new section type simply called ### News.

Are you still interested in chan register mySection or is even that considered as breaking by you and your coworker?

So what do you think?

I also see that some code blocks, indented or with triple backticks, are not handled properly. Backticks are removed and changed to an indented code block, indented code blocks get de-indented to paragraphs.

I understand that this is because the whole file is converted to data and the re-generated, but I guess it limits the usability of the tool.

commented

Hi @lud
Sorry for the late response, we are on low bandwidth at the moment. We wont be adding a register section command since this would be breaking the keep-a-changelog standard which is a core principle for this module.

I also see that some code blocks, indented or with triple backticks, are not handled properly. Backticks are removed and changed to an indented code block, indented code blocks get de-indented to paragraphs.

About this, it looks like a bug. If you can open a separate issue we can follow up there. We parse the ast of the changelog and maybe something is lost in the middle.

Thanks a lot and sorry for the delay. Hope you have a nice day.

Hey, no problem, I will add the issue. Thanks for the answer !