server/repochecker/grammalecte/flags.go

38 lines
1.0 KiB
Go
Raw Normal View History

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