Skip to main content

External

Struct External 

Source
pub struct External {
    pub id: String,
    pub short_name: String,
    pub stage: Stage,
    pub kind: Kind,
}
Expand description

A check a repository declares, rather than one compiled in.

Fields§

§id: String

<trigger>-<name> — what hook.skip and amont.severity.<key> resolve against, and what Check::name returns. Built-ins have had this shape all along; declared checks answering to a bare name were invisible to hook.skip pre-commit.

§short_name: String

The name as written in the manifest — the “short name” of the vocabulary — used for messages. A line too malformed to name itself falls back to its position, and reading pre-commit-amont.conf:3 back to somebody helps nobody.

§stage: Stage§kind: Kind

Trait Implementations§

Source§

impl Check for External

Source§

fn scope(&self) -> Scope

Derived for an unusable check rather than stored: it never runs, so its scope is a question with no answer, and computing one here keeps the DATA from carrying a value that means nothing.

Source§

fn name(&self) -> &str

Source§

fn stage(&self) -> Stage

Source§

fn severity(&self) -> Severity

Source§

fn run(&self, ctx: &Ctx<'_>) -> Outcome

Source§

fn fix(&self) -> Fix

Whether this check can repair what it finds. None for almost all.
Source§

impl From<Line> for External

Source§

fn from(l: Line) -> External

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.