Byron / cargo-smart-release

Release complex cargo-workspaces automatically with changelog generation, used by `gitoxide`
Apache License 2.0
73 stars 6 forks source link

Add filter to `cargo changelog` and map conventional commits 1:1 #6

Open simonsan opened 2 years ago

simonsan commented 2 years ago

[TRACE] Skipping unknown git-conventional kind "chore" and all 2 message(s) in it.

Maybe I'm doing something wrong, but I can't get cargo-smart-release to "find" conventional commit types like chore or feat(x). Is there something I've overlooked or doing wrong?

After a bit of research it seems that the conventional commit type is being parsed from the message, but cargo changelog doesn't want them to be written to the changelog.

I see that in the changelog generation it's not being matched for e.g. chore: https://github.com/Byron/gitoxide/blob/fbe2c93b13fc05414dc5c7d80f4197d279b6b81b/cargo-smart-release/src/changelog/section/segment.rs#L26 while in https://github.com/Byron/gitoxide/blob/fbe2c93b13fc05414dc5c7d80f4197d279b6b81b/cargo-smart-release/src/commit/message.rs#L122 these clearly exist.

I'm asking myself if it would be sensible to do the mapping 1:1 in regards to conventional commits and pass a filter to cargo changelog where someone could state that they might not want to have chores printed to the changelog file or have their own mapping parsed from a toml configuration file.

As said above, if I'm overlooking something, please correct me. :)

Thanks for the nice tooling!

Byron commented 2 years ago

That's great research right there and I can assure you that nothing has been missed. This oddity was intentional knowing that I could write a tool that just suits me, with my preferences hard-coded.

However, I see (and happily so) that cargo smart-release outgrows its original audience (me) and that comes with changing requirements. I think it's fair to not be surprising and as a first step, pass on 'kind' names unchanged with the option of passing additional filters on the command-line or via configuration files.

For now the fix is only available on main, and I will create a new release once Byron/gitoxide#316 is fixed.

Thanks for giving it a shot!