repochecker/epita: Treat labels as []rune
This commit is contained in:
parent
75bf99ed7b
commit
631b2ff990
@ -19,7 +19,8 @@ func EPITACheckKeyFlag(flag *fic.FlagKey, raw string, _ *fic.Exercice, exception
|
|||||||
flag.Label = flag.Label[1:]
|
flag.Label = flag.Label[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
if flag.Label[len(flag.Label)-1] != ')' && flag.Label[len(flag.Label)-1] != '©' && !unicode.IsLetter(rune(flag.Label[len(flag.Label)-1])) && !unicode.IsDigit(rune(flag.Label[len(flag.Label)-1])) {
|
label := []rune(flag.Label)
|
||||||
|
if flag.Label[len(flag.Label)-1] != ')' && flag.Label[len(flag.Label)-1] != '©' && !unicode.IsLetter(label[len(label)-1]) && !unicode.IsDigit(label[len(label)-1]) {
|
||||||
errs = multierr.Append(errs, fmt.Errorf("Label should not end with punct (%q). Reword your label as a description of the expected flag, `:` are automatically appended.", flag.Label[len(flag.Label)-1]))
|
errs = multierr.Append(errs, fmt.Errorf("Label should not end with punct (%q). Reword your label as a description of the expected flag, `:` are automatically appended.", flag.Label[len(flag.Label)-1]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user