repochecker: Check flag's help content through mdTextHooks
This commit is contained in:
parent
9896445e00
commit
b52622c772
@ -351,6 +351,13 @@ func buildExerciceFlag(i Importer, exercice *fic.Exercice, flag ExerciceFlag, nl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(flag.Help) > 0 {
|
if len(flag.Help) > 0 {
|
||||||
|
// Call checks hooks
|
||||||
|
for _, hk := range hooks.mdTextHooks {
|
||||||
|
for _, err := range multierr.Errors(hk(flag.Help, exercice.Language, exceptions)) {
|
||||||
|
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if mdhelp, err := ProcessMarkdown(i, flag.Help, exercice.Path); err != nil {
|
if mdhelp, err := ProcessMarkdown(i, flag.Help, exercice.Path); err != nil {
|
||||||
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("unable to parse property help as Markdown: %w", err)))
|
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("unable to parse property help as Markdown: %w", err)))
|
||||||
} else {
|
} else {
|
||||||
|
@ -27,9 +27,7 @@ func GrammalecteCheckKeyFlag(flag *fic.FlagKey, raw string, exercice *fic.Exerci
|
|||||||
errs = multierr.Append(errs, err)
|
errs = multierr.Append(errs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(flag.Help) > 0 {
|
// Flag help are checked through GrammalecteCheckMDText, no need to check them
|
||||||
errs = multierr.Append(errs, grammalecte("help ", flag.Help, -1, exceptions, &CommonOpts))
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user