fix(build): actually enforce masked prefixes verification in lint-locale-usage

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-08-04 00:30:11 +02:00
commit f2bb2016e1
3 changed files with 52 additions and 4 deletions

View file

@ -273,8 +273,10 @@ func main() {
handler := Handler{
OnMsgidPrefix: func(fset *token.FileSet, pos token.Pos, msgidPrefix string) {
// TODO: perhaps we should check if we have any strings with such a prefix, but that's slow...
allowedMaskedPrefixes.Insert(DecodeKeyForStm(msgidPrefix))
if !allowedMaskedPrefixes.Matches(DecodeKeyForStm(msgidPrefix)) {
gotAnyMsgidError = true
fmt.Printf("%s:\tmissing msgid prefix: %s\n", fset.Position(pos).String(), msgidPrefix)
}
},
OnMsgid: func(fset *token.FileSet, pos token.Pos, msgid string) {
if !msgids.Contains(msgid) {