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
|
continue
|
||||||
}
|
}
|
||||||
if fix {
|
if fix {
|
||||||
if err := os.WriteFile(path, formatted, 0644); err != nil {
|
if err := os.WriteFile(path, formatted, 0600); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
@ -128,13 +128,19 @@ func scanCodeKeys(roots []string) (map[string]struct{}, []string, error) {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if entry.Type()&os.ModeSymlink != 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if filepath.Ext(path) != ".go" {
|
if filepath.Ext(path) != ".go" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(path, "_test.go") {
|
if strings.HasSuffix(path, "_test.go") {
|
||||||
return nil
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@
|
||||||
"minLength": 1
|
"minLength": 1
|
||||||
},
|
},
|
||||||
"propertyNames": {
|
"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