sync: Introduce repochecker-ack.txt to support check exceptions
This commit is contained in:
parent
edde9f885d
commit
fb368d79d1
17 changed files with 283 additions and 106 deletions
|
@ -9,13 +9,15 @@ import (
|
|||
|
||||
var hooks = &CheckHooks{}
|
||||
|
||||
type CheckFlagChoiceHook func(*fic.FlagChoice) []error
|
||||
type CheckFlagKeyHook func(*fic.FlagKey, string) []error
|
||||
type CheckFlagKeyWithChoicesHook func(*fic.FlagKey, string, []*fic.FlagChoice) []error
|
||||
type CheckFlagLabelHook func(*fic.FlagLabel) []error
|
||||
type CheckFlagMCQHook func(*fic.MCQ, []*fic.MCQ_entry) []error
|
||||
type CheckFileHook func(*fic.EFile) []error
|
||||
type CheckHintHook func(*fic.EHint) []error
|
||||
type CheckFlagChoiceHook func(*fic.FlagChoice, *CheckExceptions) []error
|
||||
type CheckFlagKeyHook func(*fic.FlagKey, string, *CheckExceptions) []error
|
||||
type CheckFlagKeyWithChoicesHook func(*fic.FlagKey, string, []*fic.FlagChoice, *CheckExceptions) []error
|
||||
type CheckFlagLabelHook func(*fic.FlagLabel, *CheckExceptions) []error
|
||||
type CheckFlagMCQHook func(*fic.MCQ, []*fic.MCQ_entry, *CheckExceptions) []error
|
||||
type CheckFileHook func(*fic.EFile, *CheckExceptions) []error
|
||||
type CheckHintHook func(*fic.EHint, *CheckExceptions) []error
|
||||
type CheckMDTextHook func(string, *CheckExceptions) []error
|
||||
type CheckExerciceHook func(*fic.Exercice, *CheckExceptions) []error
|
||||
|
||||
type CheckHooks struct {
|
||||
flagChoiceHooks []CheckFlagChoiceHook
|
||||
|
@ -25,6 +27,8 @@ type CheckHooks struct {
|
|||
flagMCQHooks []CheckFlagMCQHook
|
||||
fileHooks []CheckFileHook
|
||||
hintHooks []CheckHintHook
|
||||
mdTextHooks []CheckMDTextHook
|
||||
exerciceHooks []CheckExerciceHook
|
||||
}
|
||||
|
||||
func (h *CheckHooks) RegisterFlagChoiceHook(f CheckFlagChoiceHook) {
|
||||
|
@ -55,6 +59,14 @@ func (h *CheckHooks) RegisterHintHook(f CheckHintHook) {
|
|||
h.hintHooks = append(h.hintHooks, f)
|
||||
}
|
||||
|
||||
func (h *CheckHooks) RegisterMDTextHook(f CheckMDTextHook) {
|
||||
h.mdTextHooks = append(h.mdTextHooks, f)
|
||||
}
|
||||
|
||||
func (h *CheckHooks) RegisterExerciceHook(f CheckExerciceHook) {
|
||||
h.exerciceHooks = append(h.exerciceHooks, f)
|
||||
}
|
||||
|
||||
func LoadChecksPlugin(fname string) error {
|
||||
p, err := plugin.Open(fname)
|
||||
if err != nil {
|
||||
|
|
Reference in a new issue