forked from Gitlink/gitlink-cli
fix(i18n): align schema and check tool lint
This commit is contained in:
parent
37dfd2e2e2
commit
39306994bc
|
|
@ -61,7 +61,7 @@ func checkLocaleFormat(fix bool) error {
|
|||
continue
|
||||
}
|
||||
if fix {
|
||||
if err := os.WriteFile(path, formatted, 0644); err != nil {
|
||||
if err := os.WriteFile(path, formatted, 0600); err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
|
|
@ -128,13 +128,19 @@ func scanCodeKeys(roots []string) (map[string]struct{}, []string, error) {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
if entry.Type()&os.ModeSymlink != 0 {
|
||||
return nil
|
||||
}
|
||||
if filepath.Ext(path) != ".go" {
|
||||
return nil
|
||||
}
|
||||
if strings.HasSuffix(path, "_test.go") {
|
||||
return nil
|
||||
}
|
||||
data, err := os.ReadFile(path)
|
||||
if !entry.Type().IsRegular() {
|
||||
return nil
|
||||
}
|
||||
data, err := os.ReadFile(path) // #nosec G122 -- dev-only scan over repo roots; symlinks are skipped above.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
"minLength": 1
|
||||
},
|
||||
"propertyNames": {
|
||||
"pattern": "^(cmd|flag|error|output|prompt|table)\\.[a-z0-9_.-]+$"
|
||||
"pattern": "^(cmd|flag|error|output|prompt|success|warning|table)\\.[a-z0-9_.-]+$"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue