repochecker/grammalecte: Add a custom hook CheckGrammar
This commit is contained in:
parent
5d07634d0d
commit
d7ff10762e
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"srs.epita.fr/fic-server/admin/sync"
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
@ -41,3 +43,12 @@ func GrammalecteCheckMDText(str string, exceptions *sync.CheckExceptions) (errs
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
func GrammalecteCheckGrammar(data interface{}, exceptions *sync.CheckExceptions) (errs []error) {
|
||||
if s, ok := data.(string); ok {
|
||||
return grammalecte("", s, exceptions, &CommonOpts)
|
||||
} else {
|
||||
log.Printf("Unknown data given to GrammalecteCheckGrammar: %T", data)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,5 +96,7 @@ func RegisterChecksHooks(h *sync.CheckHooks) {
|
|||
h.RegisterFlagChoiceHook(GrammalecteCheckFlagChoice)
|
||||
h.RegisterHintHook(GrammalecteCheckHint)
|
||||
h.RegisterMDTextHook(GrammalecteCheckMDText)
|
||||
|
||||
h.RegisterCustomHook("CheckGrammar", GrammalecteCheckGrammar)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue