File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
src/main/java/io/github/willena/maven/plugins/githooks Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 199
199
</execution >
200
200
</executions >
201
201
</plugin >
202
+ <plugin >
203
+ <groupId >org.eclipse.sisu</groupId >
204
+ <artifactId >sisu-maven-plugin</artifactId >
205
+ <executions >
206
+ <execution >
207
+ <id >index-project</id >
208
+ <goals >
209
+ <goal >main-index</goal >
210
+ <goal >test-index</goal >
211
+ </goals >
212
+ </execution >
213
+ </executions >
214
+ </plugin >
202
215
</plugins >
203
216
</pluginManagement >
204
217
239
252
<groupId >org.apache.maven.plugins</groupId >
240
253
<artifactId >maven-source-plugin</artifactId >
241
254
</plugin >
255
+ <plugin >
256
+ <groupId >org.eclipse.sisu</groupId >
257
+ <artifactId >sisu-maven-plugin</artifactId >
258
+ </plugin >
242
259
</plugins >
243
260
</build >
244
261
Original file line number Diff line number Diff line change 1
1
package io .github .willena .maven .plugins .githooks ;
2
2
3
+ import javax .inject .Named ;
4
+ import javax .inject .Singleton ;
3
5
import java .nio .file .Files ;
4
6
import java .nio .file .Path ;
5
7
import java .util .regex .Matcher ;
9
11
* Check if commit message follows the conventional commit format.
10
12
* Applicability: commit-msg
11
13
*/
14
+ @ Named ("CommitFollowConventional" )
15
+ @ Singleton
12
16
public class CommitFollowConventional implements RunnableGitHook {
13
17
14
18
// Adapted from https://regex101.com/r/vcxVpP/5
Original file line number Diff line number Diff line change 1
1
package io .github .willena .maven .plugins .githooks ;
2
2
3
+ import javax .inject .Named ;
4
+ import javax .inject .Singleton ;
3
5
import java .nio .file .Files ;
4
6
import java .nio .file .Path ;
5
7
import java .util .regex .Matcher ;
9
11
* Check if commit message contains an issue reference.
10
12
* Applicability: commit-msg
11
13
*/
14
+ @ Named ("CommitReferenceIssue" )
15
+ @ Singleton
12
16
public class CommitReferenceIssue implements RunnableGitHook {
13
17
private static final Pattern ISSUE_REFERENCE_PATTERN = Pattern .compile ("(?<jiraLike>\\ b[A-Za-z][A-Za-z0-9_]+-[1-9][0-9]*)|(?<issueId>#\\ d+)" , Pattern .MULTILINE | Pattern .UNICODE_CHARACTER_CLASS );
14
18
Original file line number Diff line number Diff line change 1
1
package io .github .willena .maven .plugins .githooks ;
2
2
3
3
import org .apache .maven .plugin .logging .Log ;
4
+ import org .apache .maven .project .MavenProject ;
4
5
6
+ import javax .inject .Inject ;
7
+ import javax .inject .Named ;
8
+ import javax .inject .Singleton ;
5
9
import java .util .Arrays ;
6
10
7
11
/**
8
12
* Hook that prints its inputs
9
13
* Applicability: any hooks
10
14
*/
15
+ @ Named ("Echo" )
16
+ @ Singleton
11
17
public class Echo implements RunnableGitHook {
12
18
13
19
private void log (Log log , String message ) {
You can’t perform that action at this time.
0 commit comments