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 carryLicense:, so a trigger onLicenseparagraphs only also matches Files paragraphs — pair with a separateFilestrigger if you want both).
For debian/tests/control:
paragraph_key = "Tests"selects any paragraph identified by aTests:field (the common form).paragraph_key = "Test-Command"selects any paragraph identified byTest-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
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§
impl Copy for Trigger
impl Eq for Trigger
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnsafeUnpin for Trigger
impl UnwindSafe for Trigger
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.