- repo size - forbidden files - meta files - ascii character in files - integrity check - ascii character in the commit message - release tag check Co-authored-by: Boming Zhang <bomingzh@sjtu.edu.cn> Co-authored-by: zzjc1234 <2359047351@qq.com> Co-authored-by: Hydraallen <wangruiallen@gmail.com> Reviewed-on: FOCS-dev/JOJ3#17 Co-authored-by: 周赵嘉程521432910016 <zzjc123@sjtu.edu.cn> Co-committed-by: 周赵嘉程521432910016 <zzjc123@sjtu.edu.cn>
39 lines
909 B
Go
39 lines
909 B
Go
package healthcheck
|
|
|
|
import (
|
|
"fmt"
|
|
"regexp"
|
|
)
|
|
|
|
func inString(str1 string, strList []string) bool {
|
|
for _, str := range strList {
|
|
if str1 == str {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// addExt appends the specified extension to each file name in the given fileList.
|
|
// It modifies the original fileList in place.
|
|
func addExt(fileList []string, ext string) {
|
|
for i, file := range fileList {
|
|
fileList[i] = file + ext
|
|
}
|
|
}
|
|
|
|
// getRegex compiles each regex pattern in the fileList into a []*regexp.Regexp slice.
|
|
// It returns a slice containing compiled regular expressions.
|
|
func getRegex(fileList []string) ([]*regexp.Regexp, error) {
|
|
var regexList []*regexp.Regexp
|
|
for _, pattern := range fileList {
|
|
regex, err := regexp.Compile("(?i)" + pattern)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Error compiling regex:%w", err)
|
|
}
|
|
regexList = append(regexList, regex)
|
|
}
|
|
|
|
return regexList, nil
|
|
}
|