sync: Better perform exception in exercices

This commit is contained in:
nemunaire 2023-07-09 19:05:58 +02:00
parent edbb867f62
commit dc83efa868
8 changed files with 45 additions and 34 deletions

View file

@ -109,12 +109,10 @@ func searchBinaryInGit(edir string) (ret []string) {
}
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)
e, _, eid, exceptions, _, berrs := sync.BuildExercice(sync.GlobalImporter, theme, path.Join(theme.Path, edir), dmap, nil)
errs = append(errs, berrs...)
if e != nil {
exceptions = exceptions.GetExerciceExceptions(e)
// Files
var files []string
var cerrs []error
@ -263,7 +261,9 @@ func main() {
dmap := map[int64]*fic.Exercice{}
for _, edir := range exercices {
for _, err := range checkExercice(theme, edir, &dmap, exceptions) {
ex_exceptions := exceptions.GetFileExceptions(edir)
for _, err := range checkExercice(theme, edir, &dmap, ex_exceptions) {
log.Println(err.Error())
if logMissingResolution {
@ -293,7 +293,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{}, exceptions) {
for _, err := range checkExercice(&fic.Theme{}, p, &map[int64]*fic.Exercice{}, nil) {
nberr += 1
log.Println(err)
}