grammalecte: Force capital letter only if first char is a letter
Fixes: https://gitlab.cri.epita.fr/ing/majeures/srs/fic/server/-/issues/34
This commit is contained in:
parent
130bb0c092
commit
9896445e00
@ -39,7 +39,7 @@ func GrammalecteCheckFlagChoice(choice *fic.FlagChoice, exercice *fic.Exercice,
|
|||||||
errs = multierr.Append(errs, grammalecte("label ", choice.Label, -1, exceptions, &CommonOpts))
|
errs = multierr.Append(errs, grammalecte("label ", choice.Label, -1, exceptions, &CommonOpts))
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(multierr.Errors(errs)) == 0 && !unicode.IsUpper(bytes.Runes([]byte(choice.Label))[0]) && !exceptions.HasException(":label_majuscule") {
|
if len(multierr.Errors(errs)) == 0 && unicode.IsLetter(bytes.Runes([]byte(choice.Label))[0]) && !unicode.IsUpper(bytes.Runes([]byte(choice.Label))[0]) && !exceptions.HasException(":label_majuscule") {
|
||||||
errs = multierr.Append(errs, fmt.Errorf("%q nécessite une majuscule (:label_majuscule)", choice.Label))
|
errs = multierr.Append(errs, fmt.Errorf("%q nécessite une majuscule (:label_majuscule)", choice.Label))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user