Skip to content

A linter to check git commit messages. It is a Maven plugin written in Java and can be used by importing in other Maven project and set a pattern to check commit messages, if the commit message does not match, the commit fails.

Notifications You must be signed in to change notification settings

PaulRps/commitmessagelinter-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commitmessagelinter-maven-plugin

Example

Basic Configuration

First, Add that in your root POM.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>com.github.paulrps</groupId>
            <artifactId>commitmessagelinter-maven-plugin</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <configuration>
                <project>${project}</project>
                <commitMessage>${commitMessage}</commitMessage>
                <regex>^IssueId: #\d+</regex>
                <disableValidationMessage>false</disableValidationMessage>
            </configuration>
        </plugin>
    </plugins>
</build>

If there is more than one .git folder in the project base directory (for example submodules), every commit in all of them will be validated.

Then, install the hook commit message file by running the maven goal install-hook:

mvn com.paulrps:commitmessagelinter-maven-plugin:install-hook

So, when you execute git commit -m "message", this will be validated by configuration.regex parameter in your POM.xml file.

About

A linter to check git commit messages. It is a Maven plugin written in Java and can be used by importing in other Maven project and set a pattern to check commit messages, if the commit message does not match, the commit fails.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages