Skip to main content

Trigger

Enum Trigger 

Source
pub enum Trigger {
    File(&'static str),
    Glob(&'static str),
    Deb822Field {
        file: &'static str,
        paragraph_key: &'static str,
        field: &'static str,
    },
    Watch(WatchAspect),
    Changelog(ChangelogAspect),
    UpstreamMetadataField(&'static str),
    DebcargoField(&'static str),
}
Expand description

What workspace state a detector cares about.

LSP hosts use these to avoid running every detector on every keystroke: when the user edits a file, only detectors whose triggers match the changed location need to re-run. The lintian-brush CLI ignores triggers and runs every registered detector unconditionally.

The lifetimes here are 'static because triggers are declared at build time via [declare_detector!] and stored in [DetectorRegistration].

Variants§

§

File(&'static str)

Detector cares about a file at this exact workspace-relative path.

§

Glob(&'static str)

Detector cares about any file matching this glob (workspace-relative). Common cases: "debian/*.service", "debian/*.lintian-overrides".

§

Deb822Field

Detector cares about a single deb822 field, named by field, in any paragraph that contains a key matching paragraph_key.

paragraph_key is the name of an identifying field — its presence in a paragraph selects that paragraph as the trigger scope. For debian/control:

  • paragraph_key = "Source" selects the source paragraph.
  • paragraph_key = "Package" selects any binary paragraph.

For debian/copyright (DEP-5 machine-readable):

  • paragraph_key = "Format" selects the header paragraph.
  • paragraph_key = "Files" selects any Files paragraph.
  • paragraph_key = "License" selects any standalone License paragraph (Files paragraphs also carry License:, so a trigger on License paragraphs only also matches Files paragraphs — pair with a separate Files trigger if you want both).

For debian/tests/control:

  • paragraph_key = "Tests" selects any paragraph identified by a Tests: field (the common form).
  • paragraph_key = "Test-Command" selects any paragraph identified by Test-Command: (an alternative form).

Field names may end in a single * to match a prefix (Vcs-*); a bare "*" matches any field in the paragraph.

Fields

§file: &'static str

Workspace-relative path of the deb822 file.

§paragraph_key: &'static str

Identifying field name selecting the paragraph kind.

§field: &'static str

Field name; * is a prefix wildcard or full match-any.

§

Watch(WatchAspect)

Detector cares about an aspect of debian/watch, expressed in terms of the watch-file conceptual model rather than the underlying syntax (line-based v1-4 vs deb822 v5). Hosts map this onto whichever syntactic form the package happens to use.

§

Changelog(ChangelogAspect)

Detector cares about an aspect of debian/changelog. See ChangelogAspect.

§

UpstreamMetadataField(&'static str)

Detector cares about a top-level field in debian/upstream/metadata (the YAML DEP-12 file).

Field names follow the same wildcard rules as [Deb822Field::field]: a trailing * matches a prefix (e.g. "Bug-*" covers Bug-Database and Bug-Submit), and a bare "*" matches any top-level field.

§

DebcargoField(&'static str)

Detector cares about a specific key inside debian/debcargo.toml.

path is a dot-separated TOML key path from the document root, e.g. "source.homepage" or "source.vcs_git". A bare "*" matches any top-level key; a trailing ".*" matches all keys within a table (e.g. "source.*").

Trait Implementations§

Source§

impl Clone for Trigger

Source§

fn clone(&self) -> Trigger

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Trigger

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Trigger

Source§

fn eq(&self, other: &Trigger) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Trigger

Source§

impl Eq for Trigger

Source§

impl StructuralPartialEq for Trigger

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Ungil for T
where T: Send,