rust-av/Av1an

Zone parser should return all errors instead of just the first one and provide context

Ouverte

#1 095 ouverte le 26 juil. 2025

 (0 commentaire) (0 réaction) (0 personne assignée)Rust (188 forks)auto 404
enhancementgood first issue

Métriques du dépôt

Stars
 (1 958 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

parse_zones() will call Scene::parse_from_zone() for each line in the provided zones file. However, when Scene::parse_from_zone() encounters a validation error, it immediately returns without evaluating the rest of the parameters. parse_zones() will also bubble up that error immediately as well. This leads to the user debugging a malformed zones file input error-by-error, which is a cumbersome task if the zones file has more than a handful of invalid values.

Instead, Scene::parse_from_zone() should greedily evaluate all inputs in the line and compile all the validation errors and return them in bulk. parse_zones() will further compile these for all lines and finally return the full list of validation errors. Warnings should be similarly compiled and returned with the Ok value. We could use a Tuple like (OK_VALUE,Option<Vec<ValidationWarning>>).

Additionally, in order to help the user quickly find the offending line(s), we should attach context like the line number and/or the start/end frame index so they know where to debug their zones file.

Thank you, - Boats M.

Guide contributeur