repochecker/grammalecte: Allow including quotes without checking
This commit is contained in:
parent
d7ff10762e
commit
ac25202024
1 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"srs.epita.fr/fic-server/admin/sync"
|
"srs.epita.fr/fic-server/admin/sync"
|
||||||
"srs.epita.fr/fic-server/libfic"
|
"srs.epita.fr/fic-server/libfic"
|
||||||
|
@ -35,10 +36,21 @@ func GrammalecteCheckHint(hint *fic.EHint, exceptions *sync.CheckExceptions) (er
|
||||||
errs = append(errs, grammalecte("title ", hint.Title, exceptions, &CommonOpts)...)
|
errs = append(errs, grammalecte("title ", hint.Title, exceptions, &CommonOpts)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hint content are checked through GrammalecteCheckMDText, no need to check them
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GrammalecteCheckMDText(str string, exceptions *sync.CheckExceptions) (errs []error) {
|
func GrammalecteCheckMDText(str string, exceptions *sync.CheckExceptions) (errs []error) {
|
||||||
|
if exceptions != nil {
|
||||||
|
for k := range *exceptions {
|
||||||
|
tmp := strings.SplitN(k, ":", 3)
|
||||||
|
if len(tmp) == 3 && tmp[1] == "quote" {
|
||||||
|
str = strings.Replace(str, tmp[3], "une citation a été remplacée ici", -1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
errs = append(errs, grammalecte("", str, exceptions, &CommonOpts)...)
|
errs = append(errs, grammalecte("", str, exceptions, &CommonOpts)...)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Reference in a new issue