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.

貢獻者指南