Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/docs/commands/doctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Commands:

`scope doctor run` is used to execute all the doctor steps. All checks will be run, if you want to only run specific checks, the `--only` flag with the name of the check to run. This option can be provided multiple times.

If you want to remove a group from the run instead, use `--skip`. Skipping a group also removes any
of its dependencies that aren't also required by another group still in the run — a dependency
shared with a non-skipped group keeps running. This option can be provided multiple times.

If you only want to remove the named group itself, and let its dependencies keep running, use
`--skip-only` instead.

A group can also skip itself via its [`skip` config](../models/ScopeDoctorGroup.mdx#skip)
(`skip: true` or a `skip` command); it's resolved the same way `--skip` is, trimming that group's
dependency subtree.

By default, any provided fix's will be run. If you don't want to run fixes add `--fix=false` to disable fixing issues.

When using a [ScopeDoctorGroup](../models/ScopeDoctorGroup.mdx), the checksum of files are stored on disk. If you need to disable caching, add `--no-cache`.
Expand All @@ -34,6 +45,8 @@ Usage: scope doctor run [OPTIONS]

Options:
-o, --only <ONLY> When set, only the checks listed will run
--skip <SKIP> When set, these groups are removed from the run, along with any dependency that isn't also required by a group that's still included
--skip-only <SKIP_ONLY> When set, only the named groups are removed from the run; their dependencies still run
-f, --fix <FIX> When set, if a fix is specified it will also run [default: true] [possible values: true, false]
-n, --no-cache When set cache will be disabled, forcing all file based checks to run
--yolo Automatically approve all fix prompts without asking
Expand Down
11 changes: 11 additions & 0 deletions docs/docs/models/ScopeDoctorGroup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ In the event there are no defined check, the fix will _always_ run.
When the checks determine that something isn't correct, a fix is the way to automate the resolution.
When provided, `scope` will run them in order.

## Skip

`spec.skip` lets a group opt itself out of a run, either unconditionally (`skip: true`) or based
on a command's exit code (`skip: { command: ... }`, skipped when the command exits `0`).

The skip decision is resolved during planning, before the run graph is built, so it behaves the
same as passing `--skip <name>` on the command line: the group is removed along with any
dependency that isn't also required by another group still in the run. A shared dependency (one
also required by a non-skipped group) is kept. The skipped group is still reported in the run
summary; its dependencies that get trimmed along with it are not.

## Commands

A command can either be relative, or use the PATH.
Expand Down
9 changes: 7 additions & 2 deletions src/doctor/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Result;
use clap::Args;
use tracing::instrument;

use crate::doctor::runner::compute_group_order;
use crate::doctor::runner::{GroupOrderParams, compute_group_order};
use crate::report_stdout;
use crate::shared::prelude::{DoctorGroup, FoundConfig};
use crate::shared::print_details;
Expand All @@ -28,7 +28,12 @@ pub fn generate_doctor_list(found_config: &FoundConfig) -> Vec<DoctorGroup> {
.filter(|(_, v)| v.run_by_default)
.map(|(k, _)| k.to_string()),
);
let group_order = compute_group_order(&found_config.doctor_group, all_keys);
let group_order = compute_group_order(GroupOrderParams {
groups: &found_config.doctor_group,
desired_groups: &all_keys,
skip_subtree: &BTreeSet::new(),
skip_only: &BTreeSet::new(),
});

group_order
.iter()
Expand Down
Loading
Loading