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