Expand description
Shared lint emission for the proto-first (obs-build::codegen) and
Rust-first (obs-macros::derive_event) authoring paths.
Decision D8-1 (spec 95 § 5): both paths build a LintInput and
call emit_lints. Each LintError carries a stable code
(L001..L014) and the same human-readable message regardless of
which path produced it; the consumer (codegen.rs / derive_event.rs)
formats the errors into either Rust source text or proc_macro2
tokens.
This module has no proc_macro2/quote/syn dep so it can be
linked from both an ordinary library crate (obs-build’s codegen
path) and a proc-macro crate (obs-macros’s derive path) without
pulling each other’s heavy transitive deps.
Structs§
- Lint
Error - One lint failure.
- Lint
Field - One field’s worth of lint input.
- Lint
Input - Input for the shared lint pass — one event’s worth.
Enums§
- Lint
Proto Type - Proto wire type a field declares. The proto-first path fills this
from
FieldDescriptorProto::r#type; the derive path fills it from the Rust syntactic type viaLintProtoType::from_rust_token. When the type cannot be inferred it isOther(_)and the type-checking portion of L014 simply does not fire.
Functions§
- emit_
cross_ event_ lints - Cross-event lints — currently L013 (schema_hash uniqueness within
a codegen unit). The codegen path passes every event’s
(full_name, schema_hash); the derive path runs once per event so it cannot detect collisions and skips L013. - emit_
lints - Run every lint in the catalogue against one event. Returns one
LintErrorper violation, in stable code order so generated output is deterministic. Spec 95 § 2.1 (D8-1).