sync: Introduce repochecker-ack.txt to support check exceptions

This commit is contained in:
nemunaire 2022-10-29 17:03:57 +02:00
commit fb368d79d1
17 changed files with 283 additions and 106 deletions

View file

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