repochecker/grammalecte: New plugin to check french grammar
This commit is contained in:
parent
721908ee18
commit
edde9f885d
6 changed files with 431 additions and 5 deletions
36
repochecker/grammalecte/flags.go
Normal file
36
repochecker/grammalecte/flags.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
)
|
||||
|
||||
func GrammalecteCheckKeyFlag(flag *fic.FlagKey, raw string) (errs []error) {
|
||||
label, _, _, _ := flag.AnalyzeFlagLabel()
|
||||
errs = append(errs, grammalecte("label ", label, &CommonOpts)...)
|
||||
|
||||
if len(flag.Help) > 0 {
|
||||
errs = append(errs, grammalecte("help ", flag.Help, &CommonOpts)...)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GrammalecteCheckFlagChoice(choice *fic.FlagChoice) (errs []error) {
|
||||
errs = append(errs, grammalecte("label ", choice.Label, &CommonOpts)...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GrammalecteCheckHint(hint *fic.EHint) (errs []error) {
|
||||
if len(hint.Title) > 0 {
|
||||
errs = append(errs, grammalecte("title ", hint.Title, &CommonOpts)...)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func GrammalecteCheckMDText(str string) (errs []error) {
|
||||
errs = append(errs, grammalecte("", str, &CommonOpts)...)
|
||||
|
||||
return
|
||||
}
|
Reference in a new issue