You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue or pull request for this?
I have searched the existing issues and pull requests
Feature description
I want to separate the breaking changes in the changelog from other changes, so that users can easily find them.
For example a changelog should look something like:
## Breaking Changes
### Fixes:
- Change 1
- Change 3
- Scope: Change 4
## Non-Breaking Changes
### Fixes:
- Change 2
- Scope: Change 5
### Other (commits that do not follow conventional-commits format
- Change 6
- Change 7
I've tried to implement this but filtering is currently impossible because if a commit does not follow the conventional-commits format its breaking field is missing from the context (or maybe its null?), instead of being false.
According to the Tera filter docs a value cannot be filtered if it is null (I suppose missing == null). Thus these are always dropped when filtering.
Ther result of this is that I can filter by which commits are breaking (filter(attribute='breaking', value=true)), but I cannot filter by which commits are not breaking, because their breaking field might be false, null or I suppose even missing.
Desired solution
Either a custom filter that will allow this, or the breaking field to always be set to false unless conventional commits says it must be true.
Alternatives considered
Do something like:
...
# {{ group }}
{% if commit.breaking %}{% continue %}{% endif %}
....
But that will produce an empty group if all commits in a given group are breaking.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Just by looking at the alternative provided, it seems like the easiest way. You can avoid creating an empty group by updating it like:
{% if commit.breaking %}{% continue %}{% endif %}
# {{ group }}
And the reverse of that would be {% if commit.breaking == false %}{% continue %}{% endif %}.
because their breaking field might be false, null or I suppose even missing.
Now when it comes to the actual problem, which is breaking field not existing or set to null. It happens because we cannot detect if a commit is breaking or not without parsing it. And I think setting it to false in those cases would be misleading.
Btw it would really help if you can provide minimal Git commands for the desired changelog, something like:
Is there an existing issue or pull request for this?
Feature description
I want to separate the breaking changes in the changelog from other changes, so that users can easily find them.
For example a changelog should look something like:
I've tried to implement this but filtering is currently impossible because if a commit does not follow the conventional-commits format its
breaking
field is missing from the context (or maybe itsnull
?), instead of beingfalse
.According to the Tera filter docs a value cannot be filtered if it is
null
(I suppose missing == null). Thus these are always dropped when filtering.Ther result of this is that I can filter by which commits are breaking (
filter(attribute='breaking', value=true)
), but I cannot filter by which commits are not breaking, because their breaking field might befalse
,null
or I suppose even missing.Desired solution
Either a custom filter that will allow this, or the breaking field to always be set to false unless conventional commits says it must be true.
Alternatives considered
Do something like:
But that will produce an empty group if all commits in a given group are breaking.
Additional context
No response
The text was updated successfully, but these errors were encountered: