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

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

View file

@ -108,8 +108,8 @@ func searchBinaryInGit(edir string) (ret []string) {
return
}
func checkExercice(theme *fic.Theme, edir string, dmap *map[int64]*fic.Exercice) (errs []error) {
e, _, eid, _, berrs := sync.BuildExercice(sync.GlobalImporter, theme, path.Join(theme.Path, edir), dmap)
func checkExercice(theme *fic.Theme, edir string, dmap *map[int64]*fic.Exercice, exceptions *sync.CheckExceptions) (errs []error) {
e, _, eid, _, berrs := sync.BuildExercice(sync.GlobalImporter, theme, path.Join(theme.Path, edir), dmap, exceptions)
errs = append(errs, berrs...)
if e != nil {
@ -117,7 +117,7 @@ func checkExercice(theme *fic.Theme, edir string, dmap *map[int64]*fic.Exercice)
var files []string
var cerrs []error
if !skipFileChecks {
files, cerrs = sync.CheckExerciceFiles(sync.GlobalImporter, e)
files, cerrs = sync.CheckExerciceFiles(sync.GlobalImporter, e, exceptions)
log.Printf("%d files checked.\n", len(files))
} else {
files, cerrs = sync.CheckExerciceFilesPresence(sync.GlobalImporter, e)
@ -126,12 +126,12 @@ func checkExercice(theme *fic.Theme, edir string, dmap *map[int64]*fic.Exercice)
errs = append(errs, cerrs...)
// Flags
flags, cerrs := sync.CheckExerciceFlags(sync.GlobalImporter, e, files)
flags, cerrs := sync.CheckExerciceFlags(sync.GlobalImporter, e, files, exceptions)
errs = append(errs, cerrs...)
log.Printf("%d flags checked.\n", len(flags))
// Hints
hints, cerrs := sync.CheckExerciceHints(sync.GlobalImporter, e)
hints, cerrs := sync.CheckExerciceHints(sync.GlobalImporter, e, exceptions)
errs = append(errs, cerrs...)
log.Printf("%d hints checked.\n", len(hints))
@ -242,7 +242,7 @@ func main() {
}
nberr := 0
theme, errs := sync.BuildTheme(sync.GlobalImporter, p)
theme, exceptions, errs := sync.BuildTheme(sync.GlobalImporter, p)
if theme != nil {
nberr += len(errs)
@ -260,7 +260,7 @@ func main() {
dmap := map[int64]*fic.Exercice{}
for _, edir := range exercices {
for _, err := range checkExercice(theme, edir, &dmap) {
for _, err := range checkExercice(theme, edir, &dmap, exceptions) {
log.Println(err.Error())
if logMissingResolution {
@ -290,7 +290,7 @@ func main() {
} else {
log.Printf("This is not a theme directory, run checks for exercice.\n\n")
for _, err := range checkExercice(&fic.Theme{}, p, &map[int64]*fic.Exercice{}) {
for _, err := range checkExercice(&fic.Theme{}, p, &map[int64]*fic.Exercice{}, exceptions) {
nberr += 1
log.Println(err)
}