repochecker/grammalecte: New plugin to check french grammar

This commit is contained in:
nemunaire 2022-10-29 13:36:37 +02:00
parent 721908ee18
commit edde9f885d
6 changed files with 431 additions and 5 deletions

View file

@ -0,0 +1,36 @@
package main
import (
"srs.epita.fr/fic-server/libfic"
)
func GrammalecteCheckKeyFlag(flag *fic.FlagKey, raw string) (errs []error) {
label, _, _, _ := flag.AnalyzeFlagLabel()
errs = append(errs, grammalecte("label ", label, &CommonOpts)...)
if len(flag.Help) > 0 {
errs = append(errs, grammalecte("help ", flag.Help, &CommonOpts)...)
}
return
}
func GrammalecteCheckFlagChoice(choice *fic.FlagChoice) (errs []error) {
errs = append(errs, grammalecte("label ", choice.Label, &CommonOpts)...)
return
}
func GrammalecteCheckHint(hint *fic.EHint) (errs []error) {
if len(hint.Title) > 0 {
errs = append(errs, grammalecte("title ", hint.Title, &CommonOpts)...)
}
return
}
func GrammalecteCheckMDText(str string) (errs []error) {
errs = append(errs, grammalecte("", str, &CommonOpts)...)
return
}