generate_changelog.release_hint.ReleaseRule
ReleaseRule#
- class generate_changelog.release_hint.ReleaseRule[source]#
A commit evaluation rule for hinting at the level of change.
- Parameters:
match_result (
Optional
[str
]) – Release type if a commit context matches the rule.no_match_result (
Optional
[str
]) – Release type if a commit context doesn’t match the rule.grouping (
Union
[str
,tuple
,list
,None
]) – The partial or exact grouping of the commit contextpath (
Optional
[str
]) – A globbing pattern that matches against files included in the commitbranch (
Optional
[str
]) – A regular expression pattern to match against the branch
- __init__(match_result, no_match_result='no-release', grouping=None, path=None, branch=None)[source]#
- matches_grouping(commit)[source]#
Does the commit grouping match the rule?
If
self.grouping
is a string, it checks if the string is in the commit’sgrouping
.If
self.grouping
is a list or tuple of strings, it must match the commit’sgrouping
.If
self.grouping
is a list or tuple of strings and the last item in the list is a “*”, it must match the beginning of the commit’sgrouping
.If
self.grouping
is None, it will return a match
- Parameters:
commit (
CommitContext
) – The commit context whose grouping should match- Return type:
- Returns:
True
if the grouping matches
- matches_path(commit)[source]#
Do any of the paths in the commit match the rule?
- Parameters:
commit (
CommitContext
) – The commit context whose files should match- Return type:
- Returns:
True
if any file in the commit context matches the pattern or ifself.path
isNone