chore: rename whitelistedCharsCSV to whitelistedChars
This commit is contained in:
parent
2a501f7cf6
commit
8b76780c98
|
|
@ -12,7 +12,7 @@ type Result struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func All(
|
func All(
|
||||||
rootDir, checkFileNameList, checkFileSumList, whitelistedCharsCSV,
|
rootDir, checkFileNameList, checkFileSumList, whitelistedChars,
|
||||||
allowedDomainList, actorCsvPath string,
|
allowedDomainList, actorCsvPath string,
|
||||||
metaFile []string, repoSize float64,
|
metaFile []string, repoSize float64,
|
||||||
) (res Result) {
|
) (res Result) {
|
||||||
|
|
@ -45,7 +45,7 @@ func All(
|
||||||
} else {
|
} else {
|
||||||
res.Msg += "### Meta File Check Passed\n"
|
res.Msg += "### Meta File Check Passed\n"
|
||||||
}
|
}
|
||||||
err = NonASCIIFiles(rootDir, whitelistedCharsCSV)
|
err = NonASCIIFiles(rootDir, whitelistedChars)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg += fmt.Sprintf("### Non-ASCII Characters File Check Failed:\n%s\n", err.Error())
|
res.Msg += fmt.Sprintf("### Non-ASCII Characters File Check Failed:\n%s\n", err.Error())
|
||||||
res.Failed = true
|
res.Failed = true
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,8 @@ func getNonASCII(root string, whitelist map[rune]struct{}) ([]string, error) {
|
||||||
// NonASCIIFiles checks for non-ASCII characters in files within the specified root directory.
|
// NonASCIIFiles checks for non-ASCII characters in files within the specified root directory.
|
||||||
// It prints a message with the paths to files containing non-ASCII characters, if any.
|
// It prints a message with the paths to files containing non-ASCII characters, if any.
|
||||||
// Additionally it accept a list of whitelisted characters that are allowed, repo-wide.
|
// Additionally it accept a list of whitelisted characters that are allowed, repo-wide.
|
||||||
func NonASCIIFiles(root, whitelistedCharsCSV string) error {
|
func NonASCIIFiles(root, whitelistedChars string) error {
|
||||||
whitelist := parseWhitelistedChars(whitelistedCharsCSV)
|
whitelist := parseWhitelistedChars(whitelistedChars)
|
||||||
nonASCII, err := getNonASCII(root, whitelist)
|
nonASCII, err := getNonASCII(root, whitelist)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("getting non-ascii", "err", err)
|
slog.Error("getting non-ascii", "err", err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user