pub fn normalize_exclude_package(value: &str) -> Result<String, String>Expand description
Normalize and validate one exclude_package option value: trim
whitespace, strip the optional leading dot, reject an empty result or a
value with empty components (buf.validate., buf..validate) — those
could never match a real package, so a typo would otherwise be a silent
no-op.
The plugin option-string parsers and generate_with_diagnostics all run
entries through this function so normalization cannot drift — the same
reason they share package_is_excluded.
§Errors
Returns the user-facing message for a malformed value. The error is a
plain String (not CodeGenError) deliberately: this is plugin
option-string parsing, and both plugins’ parse layers are
Result<_, String> end to end, surfaced verbatim by protoc.