pub struct ShippedChecks<F: RepositoryFacts> {
pub can_apply_patches: bool,
pub facts: F,
pub arguments: Vec<OsString>,
pub candidates: LifecycleContent,
pub allowed_worktree_dirs: Vec<PathBuf>,
pub content: ContentState,
pub scanner_settings: ScannerSettings,
pub scanner: ScannerState,
pub markdown: MarkdownState,
}Expand description
What:
The shipped policies over one invocation.
<F: RepositoryFacts> says the record
works with any one type F that provides the facts interface,
chosen where the
record is built:
real Git in the executable,
a script in tests.
Why:
Holding the provider by value keeps its remembered answers and its query count
for the whole invocation,
and lets a test read them back afterwards.
In TS you’d write (pseudocode):
type ShippedChecks<F extends RepositoryFacts> = { facts: F; arguments: string[]; candidates: LifecycleContent; allowedWorktreeDirs: string[]; content: ContentState; markdown: MarkdownState };Fields§
§can_apply_patches: boolWhether a pass may propose corrections that its caller applies; the commit path’s convergence sets it.
facts: FWhere repository facts come from.
arguments: Vec<OsString>The command’s arguments without wrapper controls;
for a direct command,
the Git
global options written before cli-git.
candidates: LifecycleContentWhat the lifecycle offers content policies.
allowed_worktree_dirs: Vec<PathBuf>Tool-cache directories exempt from linked-worktree enforcement.
content: ContentStateThe candidates once a content policy prepared them, shared by every later one.
scanner_settings: ScannerSettingsWhere the forbidden-strings rules come from: options and environment.
scanner: ScannerStateThe forbidden-strings scanner once loaded, shared by every later scan.
markdown: MarkdownStateThe Markdown autofix policy’s options, linter and exclude patterns.
Trait Implementations§
Source§impl<F: RepositoryFacts> PolicyChecks for ShippedChecks<F>
What:
impl<F: RepositoryFacts> PolicyChecks for ShippedChecks<F> provides the engine’s
interface for the shipped policies,
for any facts provider F.
Why:
One match over the typed policy identity is the whole registry of behavior:
the compiler refuses a policy without a check.
impl<F: RepositoryFacts> PolicyChecks for ShippedChecks<F>
What:
impl<F: RepositoryFacts> PolicyChecks for ShippedChecks<F> provides the engine’s
interface for the shipped policies,
for any facts provider F.
Why:
One match over the typed policy identity is the whole registry of behavior:
the compiler refuses a policy without a check.
In TS you’d write (pseudocode):
check(policy: PolicyId, trigger: PolicyTrigger): Promise<PolicyOutcome> { switch (policy) { /* ... */ } }Auto Trait Implementations§
impl<F> !RefUnwindSafe for ShippedChecks<F>
impl<F> !Send for ShippedChecks<F>
impl<F> !Sync for ShippedChecks<F>
impl<F> !UnwindSafe for ShippedChecks<F>
impl<F> Freeze for ShippedChecks<F>where
F: Freeze,
impl<F> Unpin for ShippedChecks<F>where
F: Unpin,
impl<F> UnsafeUnpin for ShippedChecks<F>where
F: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more