Skip to main content

Clippy

Struct Clippy 

Source
pub struct Clippy;
Expand description

The adapter.

Implementations§

Source§

impl Clippy

Source

pub fn invocation(features: &FeatureSet) -> Invocation

The argv that produces the stream Clippy::normalize parses, at a stated feature set.

--workspace --all-targets mirrors the gate this repository already runs (AGENTS.md), so the count a contributor sees here is the count CI will see. -D warnings is deliberately not passed: this command reports, and the levels the repository declares in [workspace.lints] are part of what is being reported.

Source

pub fn offline_invocation(features: &FeatureSet) -> Invocation

The argv for a run whose network is denied by a boundary rather than by good manners.

Clippy::invocation plus --offline, and the two are separate functions rather than a flag on one because they describe different situations rather than different preferences. On the host, cargo may legitimately reach a registry for a dependency the user has not fetched yet; that is their machine and their choice, and --locked already stops the one write into the tree that would follow. In a guest there is no interface to reach it with, so the question is only whether cargo finds that out from --offline or from a DNS timeout inside a VM.

It is worth the flag for the error message alone. Without it a missing crate surfaces as a network failure from inside a machine the user cannot see; with it, cargo says “attempting to make an HTTP request, but –offline was specified”, which [crate::lint_sandbox] turns into the one thing that would actually help — fetch it on the host first.

Source

pub fn parse( native: &[u8], ctx: &NativeContext<'_>, ) -> Result<(NormalizedReport, Summary), ExecError>

Parse a cargo --message-format=json stream, returning the normalised report and what the stream contained besides findings.

Adapter::normalize is this without the second half; the counts exist because the ephemeral report prints them, and a trait shared with stored analyzers has nowhere to carry them.

§Errors

Returns ExecError::MalformedReport when the stream carries no build-finished message — the marker that distinguishes a completed cargo run from empty output, and therefore a clean tree from a run that never happened.

Trait Implementations§

Source§

impl Adapter for Clippy

Source§

fn analyzer(&self) -> &'static str

The analyzer id — the value that appears in every layer key and finding key this adapter produces.
Source§

fn summary(&self) -> &'static str

A one-line description of what it looks for, for roteiro security status and --help.
Source§

fn languages(&self) -> &'static [&'static str]

The languages this adapter produces findings for, as the coverage matrix in ADR-0018 states them. Reported by the CLI so the claim is inspectable rather than only documented.
Source§

fn asset_ids(&self) -> &'static [&'static str]

Which pinned assets the analyzer needs before it can run offline (see crate::assets). An empty slice means it needs none.
Source§

fn host_programs(&self) -> &'static [&'static str]

Which programs must be on PATH for this analyzer to run on this host, in the order a reader would install them. Read more
Source§

fn command(&self, _assets: &AssetPaths<'_>) -> Invocation

The argv that makes the analyzer emit the native format Adapter::normalize parses, with egress configured off. Read more
Source§

fn normalize( &self, native: &[u8], ctx: &NativeContext<'_>, ) -> Result<NormalizedReport, ExecError>

Parse native output into a normalized report. Read more
Source§

impl Clone for Clippy

Source§

fn clone(&self) -> Clippy

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 Copy for Clippy

Source§

impl Debug for Clippy

Source§

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

Formats the value using the given formatter. Read more

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<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> 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.