pawamoy / git-changelog

Automatic Changelog generator using Jinja2 templates.
https://pawamoy.github.io/git-changelog
ISC License
136 stars 34 forks source link

feat: Add option to omit empty versions from output #52

Closed svenax closed 1 year ago

svenax commented 1 year ago

Ad option to omit versions with no sections from output.

pawamoy commented 1 year ago

Thanks! Can you keep the changes atomic though?

One PR for the feature, one for the code blocks languages, and one for the Atom commit convention? By the way, what is the reasoning behind this last one? This will either break the Atom convention or just make it similar to the Conventional one.

svenax commented 1 year ago

AFAIK Atomic is supposed to be based on Conventional, but I may be wrong here. Otherwise it does not pass type check since the abstract method parse_commit is not implemented.

pawamoy commented 1 year ago

I see, thanks. I'd like that we fix this in another PR :slightly_smiling_face:

svenax commented 1 year ago

Sure. If I revert that change, mypy will fail like this.

src/git_changelog/build.py:160: error: Only concrete class can be given where "tuple[str, type[CommitConvention]]" is expected  [type-abstract]

To get around it, that line needs

 "atom": AtomConvention,  # type: ignore[type-abstract]

Should I add that?

pawamoy commented 1 year ago

Sure, fine to ignore the type issue in this PR. Thanks!

I'm wondering if we could even just drop this Atom convention... The Atom repository is archived, I can't find any docs about this commit convention on the web. We could deprecate it first of course.

svenax commented 1 year ago

I split the changes into separate commits. I would be fine with removing Atom convention. As of now, does it even do anything?

pawamoy commented 1 year ago

Can you change the Mypy commit type to chore or ci? fix is reserved for actual bug fixes.

I just tried using the Atom convention: it's broken, so let's remove it. I'll handle it once this PR is merged.

pawamoy commented 1 year ago

Heh, sorry, can you squash your fix commit into the feat one :sweat_smile:? It's not a fix either, more like a refactor :stuck_out_tongue:

If you contribute again in the future I recommend splitting different changes into different PRs, that makes it easier for me to squash and reword commits if needed :slightly_smiling_face: (obviously I could checkout your branch, rebase myself and force-push but that's not very mindful).