Package com.mooltiverse.oss.nyx.data
Class CommitMessageConvention
- java.lang.Object
-
- com.mooltiverse.oss.nyx.data.CommitMessageConvention
-
public class CommitMessageConvention extends Object
This object models the fields used to configure a generic commit message convention.
The regular expression associated with this object is important and needs to define the following named capturing groups:
-type
yields to the commit message type (if any)
-scope
yields to the commit message scope (if any)
-title
yields to the commit message title (the short, 1 line, description of the commit)
The bump regular expressions provided with this object are used to determine if a commit message is meant to bump a version identifier. Each entry in the map has a version identifier as the key and a regular expression as the value. When the regular expression in the value matches the commit message then the identifier in the key has to be bumped. These regular expressions are evaluated simply, just match or no-match, without named groups etc. The order of the entries does not matter as in case of multiple matches only the most significant identifier is bumped. Identifier names depend on the versioningScheme
in use.
-
-
Constructor Summary
Constructors Constructor Description CommitMessageConvention(String expression, Map<String,String> bumpExpressions)
Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getBumpExpressions()
Returns the map where each key is a version identifier to bump and the value is a regular expression to be evaluated against the commit message.String
getExpression()
Returns the regular expression used to parse informations from a commit message.
-
-
-
Constructor Detail
-
CommitMessageConvention
public CommitMessageConvention(String expression, Map<String,String> bumpExpressions)
Standard constructor.- Parameters:
expression
- the regular expression used to parse informations from a commit message. It can't benull
and it must comply with the requirements define on top of this class documentation.bumpExpressions
- the map where each key is a version identifier to bump and the value is a regular expression to be evaluated against the commit message. When the expression matches the commit message the version identifier in the key is to be bumped. It can't benull
but it may be empty and it must comply with the requirements define on top of this class documentation.
-
-
Method Detail
-
getExpression
public String getExpression()
Returns the regular expression used to parse informations from a commit message.- Returns:
- the regular expression used to parse informations from a commit message. Never
null
.
-
getBumpExpressions
public Map<String,String> getBumpExpressions()
Returns the map where each key is a version identifier to bump and the value is a regular expression to be evaluated against the commit message. When the expression matches the commit message the version identifier in the key is to be bumped.- Returns:
- the map where each key is a version identifier to bump and the value is a regular expression to be evaluated
against the commit message. Never
null
but may be empty.
-
-