pub enum ScopeReason {
Diff,
ChangedSince,
PackageBaselines,
ChangedFiles,
Workspace,
ChangedWorkspaces,
Scope,
File,
IssueTypeFilter,
Production,
IncludeEntryExports,
}Expand description
One channel that narrowed a run to part of the project.
Serialized as kebab-case inside scope_reasons and published as an OPEN
set, the same tolerate-unknown contract gate_outcomes keys carry: a name
this build does not emit means “some narrowing”, not an error.
Which names a command can emit differs per command, because the three
narrowing predicates see different state. dead-code reads the flags
themselves and can name every channel. dupes and health see an already
resolved changed-file set and report changed-files, because at that point
the flag that produced it is gone. health reports workspace for both
--workspace and --changed-workspaces for the same reason. A consumer
must therefore not assume a given command emits a given name.
Variants§
Diff
A diff index reached the analysis, from --diff-file, --diff-stdin,
FALLOW_DIFF_FILE or the shared index a CI format installs.
ChangedSince
--changed-since.
PackageBaselines
The per-package refs of workspaces.changedSince in the config.
--no-package-baselines turns them off for one run.
ChangedFiles
A resolved changed-file set, on the commands that see the set rather than the flag that produced it.
Workspace
--workspace. On health this also covers --changed-workspaces,
which it cannot distinguish.
ChangedWorkspaces
--changed-workspaces.
Scope
--scope.
File
One or more --file.
IssueTypeFilter
An active issue-type filter such as --unused-exports, which drops
whole baseline categories before the comparison.
Production
Production mode, from the flag or the resolved project config. It drops test, story and dev files at discovery.
IncludeEntryExports
--include-entry-exports or the includeEntryExports config key. It
changes which exports unused-exports reports, so the run judges a
different export surface than a run without it.
Implementations§
Source§impl ScopeReason
impl ScopeReason
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The kebab-case name this reason serializes as, for prose that has to name it outside the JSON envelope.
Sourcepub const fn is_removable_by_rerun(self) -> bool
pub const fn is_removable_by_rerun(self) -> bool
Whether repeating the run without this channel judges the same project.
A channel the caller added for one run, a diff, a base ref, a path or an
issue-type filter, is removable: dropping it widens the run to the whole
project, which is exactly what judging a whole-project baseline needs.
Production mode and workspace scoping are the caller’s own statement
about what the project is, and they resolve from the project config and
the environment as well as from a flag, so repeating the command without
the flag analyzes something nobody asked about and, on the config and
environment routes, is not even narrower. The package map is the one
config channel that is removable: --no-package-baselines turns it off
for the repeated run.
This is the rule the GitHub Action and the GitLab template already apply
before re-reading a baseline unscoped, and the one the scope_reasons
documentation states.
Trait Implementations§
Source§impl Clone for ScopeReason
impl Clone for ScopeReason
impl Copy for ScopeReason
Source§impl Debug for ScopeReason
impl Debug for ScopeReason
Source§impl<'de> Deserialize<'de> for ScopeReason
impl<'de> Deserialize<'de> for ScopeReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ScopeReason
Source§impl From<ScopeReason> for FindingIdQueryReason
impl From<ScopeReason> for FindingIdQueryReason
Source§fn from(reason: ScopeReason) -> Self
fn from(reason: ScopeReason) -> Self
Source§impl Ord for ScopeReason
impl Ord for ScopeReason
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ScopeReason
impl PartialEq for ScopeReason
Source§impl PartialOrd for ScopeReason
impl PartialOrd for ScopeReason
Source§impl Serialize for ScopeReason
impl Serialize for ScopeReason
impl StructuralPartialEq for ScopeReason
Auto Trait Implementations§
impl Freeze for ScopeReason
impl RefUnwindSafe for ScopeReason
impl Send for ScopeReason
impl Sync for ScopeReason
impl Unpin for ScopeReason
impl UnsafeUnpin for ScopeReason
impl UnwindSafe for ScopeReason
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.