소스 검색

fix: 修复commit日志总是抛出不合规范的问题,并对规范进行补充

ZhengZiHan 2 년 전
부모
커밋
8ed236499d

+ 1 - 1
web/src/main/java/cn/seecoder/web/core/commit/CommitResolver.java

@@ -23,7 +23,7 @@ public class CommitResolver {
         CommitType type = resolveType(title);
         CommitState state = resolveState(title);
         int id = resolveId(title);
-        if (type != CommitType.UNKNOWN && state != CommitState.UNKNOWN && id != -1){
+        if (type != CommitType.UNKNOWN && state != CommitState.UNKNOWN){
             return new CommitRule(type,state,id);
         } else{
             return null;

+ 19 - 0
web/src/main/java/cn/seecoder/web/core/commit/model/CommitType.java

@@ -13,6 +13,25 @@ public enum CommitType {
     FIX("fix"),
     @JsonProperty("feat")
     FEAT("feat"),
+    @JsonProperty("docs")
+    DOCS("docs"),
+    @JsonProperty("style")
+    STYLE("style"),
+    @JsonProperty("refactor")
+    REFACTOR("refactor"),
+    @JsonProperty("perf")
+    PERF("perf"),
+    @JsonProperty("test")
+    TEST("test"),
+    @JsonProperty("build")
+    BUILD("build"),
+    @JsonProperty("ci")
+    CI("ci"),
+    @JsonProperty("chore")
+    CHORE("chore"),
+    @JsonProperty("revert")
+    REVERT("revert"),
+
     @JsonProperty("unknown")
     UNKNOWN("unknown");