rust-av/Av1an

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

开放

#1,095 创建于 2025年7月26日

 (0 条评论) (0 个反应) (0 位负责人)Rust (188 个派生)auto 404
enhancementgood first issue

仓库指标

星标
 (1,958 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南