From 70012012c400b23d9dd4d3b3f7f0f7fa044fe9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E8=B5=B5=E5=98=89=E7=A8=8B521432910016?= Date: Tue, 8 Oct 2024 09:10:55 +0800 Subject: [PATCH] fix: milestone number (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: zzjc1234 <2359047351@qq.com> Reviewed-on: https://focs.ji.sjtu.edu.cn/git/JOJ/JOJ3/pulls/48 Co-authored-by: 周赵嘉程521432910016 Co-committed-by: 周赵嘉程521432910016 --- cmd/repo-health-checker/main.go | 3 ++- examples/clangtidy/sillycode | 2 +- pkg/healthcheck/tag.go | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/repo-health-checker/main.go b/cmd/repo-health-checker/main.go index 1766c0b..1cc28aa 100644 --- a/cmd/repo-health-checker/main.go +++ b/cmd/repo-health-checker/main.go @@ -47,6 +47,7 @@ func main() { droneBranch := flag.String("droneBranch", "", "") releaseCategories := flag.String("releaseCategories", "", "") releaseNumber := flag.Int("releaseNumber", 0, "") + mileStoneNumber := flag.Int("mileStoneNumber", 0, "") checkFileNameList := flag.String("checkFileNameList", "", "Comma-separated list of files to check.") checkFileSumList := flag.String("checkFileSumList", "", "Comma-separated list of expected checksums.") parseMultiValueFlag(&gitWhitelist, "whitelist", "") @@ -78,7 +79,7 @@ func main() { if err != nil { fmt.Printf("### Non-ASCII Characters Commit Message Check Failed:\n%s\n", err.Error()) } - err = healthcheck.CheckTags(*rootDir, *releaseCategories, *releaseNumber) + err = healthcheck.CheckTags(*rootDir, *releaseCategories, *releaseNumber, *mileStoneNumber) if err != nil { fmt.Printf("### Release Tag Check Failed:\n%s\n", err.Error()) } diff --git a/examples/clangtidy/sillycode b/examples/clangtidy/sillycode index 30b1798..4bb5498 160000 --- a/examples/clangtidy/sillycode +++ b/examples/clangtidy/sillycode @@ -1 +1 @@ -Subproject commit 30b179812335b427a431c303ed3453779f898796 +Subproject commit 4bb5498b5c0712f2ddbeb837c2e0aed89bea736e diff --git a/pkg/healthcheck/tag.go b/pkg/healthcheck/tag.go index 80c343f..ee94f46 100644 --- a/pkg/healthcheck/tag.go +++ b/pkg/healthcheck/tag.go @@ -31,7 +31,7 @@ func getTagsFromRepo(repoPath string) ([]string, error) { return tags, nil } -func CheckTags(repoPath string, category string, n int) error { +func CheckTags(repoPath string, category string, n int, m int) error { // INFO: if category not specified, skipping this check by default if category == "" { return nil @@ -52,6 +52,9 @@ func CheckTags(repoPath string, category string, n int) error { prefix = "a" } target := prefix + fmt.Sprintf("%d", n) + if category == "project" { + target += fmt.Sprintf("m%d", m) + } found := false for _, tag := range tags { if tag == target {