pub struct Patch<S: PatchState = Raw> { /* private fields */ }Implementations§
Source§impl<S: PatchState> Patch<S>
impl<S: PatchState> Patch<S>
pub fn files(&self) -> &[PatchedFile]
Source§impl Patch<Raw>
impl Patch<Raw>
pub fn parse(input: &[u8]) -> Result<Self, PatchError>
Sourcepub fn analyze(self) -> Patch<Analyzed>
pub fn analyze(self) -> Patch<Analyzed>
Run the per-file analyzer with no macro context. Equivalent to
analyze_with_macros(&BTreeMap::new()).
Sourcepub fn analyze_with_macros(
self,
macros_by_path: &BTreeMap<PathBuf, MacroTable>,
) -> Patch<Analyzed>
pub fn analyze_with_macros( self, macros_by_path: &BTreeMap<PathBuf, MacroTable>, ) -> Patch<Analyzed>
Run the per-file analyzer. Each PatchedFile already carries a
SourceKind tag from the diff parser; the analyzer dispatches per
file. Erlang files run through the call-site extractor; Elixir
files are recorded as unsupported so the evaluator can emit
Reason::UnsupportedFileType rather than silently flagging the
patch as Compatible. Files with SourceKind::Other (build
scripts, markdown, etc.) are still silent-skipped.
macros_by_path supplies a per-file macro table built from the
source pin’s content (including resolved -include chains).
Calls hidden behind ?Name and ?Name:f(args) are resolved
against the matching file’s table; apply-family BIFs use it to
resolve macro-module arguments.
Source§impl Patch<Analyzed>
impl Patch<Analyzed>
pub fn referenced(&self) -> &[SymbolRef]
pub fn defined(&self) -> &[SymbolRef]
Sourcepub fn with_extra_references(
self,
refs: impl IntoIterator<Item = SymbolRef>,
) -> Self
pub fn with_extra_references( self, refs: impl IntoIterator<Item = SymbolRef>, ) -> Self
Fold in references a caller extracted from a source the core
analyzer does not parse itself, such as the Erlang bodies inside a
cuttlefish .schema file. The merged set is re-sorted and deduped
on kind, keeping the strongest origin, exactly as analyze leaves
its own references.
Sourcepub fn is_only_test_visibility_change(&self) -> bool
pub fn is_only_test_visibility_change(&self) -> bool
True when every changed .erl hunk is a Variant A unwrap of
test-only -ifdef(TEST) guards (see
InapplicableReason::OnlyTestVisibilityChanged). Callers stamp
the result onto each PinVerdict.touched.only_test_visibility
so the inapplicable promoter can flip the verdict.
Sourcepub fn evaluate_series<C: EvaluationInput>(
self,
contexts: &[C],
) -> SeriesEvaluation
pub fn evaluate_series<C: EvaluationInput>( self, contexts: &[C], ) -> SeriesEvaluation
Scope-aware evaluation. Out-of-scope call sites and record
references are skipped per pin and tallied series-wide into a
Diagnostics envelope kept strictly outside Verdict.reasons.
Generic over EvaluationInput so callers pass Scoped (no file
checks) or Sourced (with file-context checks) contexts.