From 5b7f29381e43e93330dab2b942ed371e9e8245b8 Mon Sep 17 00:00:00 2001 From: Kirill Mokevnin Date: Thu, 19 Nov 2026 08:11:23 -0500 Subject: [PATCH] fix(report)!: name narrowing, evidence gaps and accepted gaps apart in every format Each note a run makes of itself has one kind (`narrowed`, `evidence-gap`, `accepted-gap`, `unused-allowance`, `cache`), and every output format names it the same way; none says "partial". - GitHub titles annotations `easement `, and gives one `easement accepted-gap` notice per `uncovered_ok` entry. - SARIF gives the accepted gaps as `note` notifications with their files as locations; each notification carries its kind as `descriptor.id`, declared in `tool.driver.notifications`. - JUnit opens each line of `` with its kind and lists accepted gaps there, never as a failed test case. - `propose` ends with the reasons, `(narrowed: --no-graph; 1 evidence gap)`, instead of `(partial)`. - `graph` prints on stderr the gaps that leave dependencies out of the drawing, accepted files among them, and the accepted gaps, as every other command does. - `report::Confidence` and `Coverage::confidence()` are gone. Closes #216 BREAKING CHANGE: GitHub annotations of a narrowing or an evidence gap are titled `easement narrowed` and `easement evidence-gap` instead of `easement partial`; SARIF notifications carry a descriptor and JUnit's `` lines open with their kind; `propose` no longer ends with `(partial)`; `graph` prints its gaps on stderr as a block instead of `easement: partial: ...` lines. Co-Authored-By: Claude Opus 5.5 --- docs/adoption.md | 2 +- docs/configuration.md | 2 +- docs/languages.md | 2 +- easement.schema.json | 2 +- skills/easement/SKILL.md | 2 +- src/commands.rs | 42 +- src/config/mod.rs | 3 +- src/main.rs | 4 +- src/propose.rs | 7 +- src/report.rs | 419 +++++++++++++++--- tests/cli.rs | 9 + tests/library/answers.rs | 9 +- tests/library/evidence.rs | 25 +- tests/library/externals.rs | 10 +- tests/library/formats.rs | 211 ++++++++- tests/library/propose.rs | 6 + .../library__plan__check_plan_github.snap | 2 +- ...sions__check_suppression_added_github.snap | 2 +- 18 files changed, 650 insertions(+), 109 deletions(-) diff --git a/docs/adoption.md b/docs/adoption.md index 316e3d2..5622441 100644 --- a/docs/adoption.md +++ b/docs/adoption.md @@ -42,7 +42,7 @@ A key given next to `<<` wins over the merged one, and a list is replaced, not j ## In CI -`--format` picks the report: `text` (default), `json`, `sarif` (GitHub Code Scanning), `github` (annotations on the changed files, with a warning for each part of the code the check could not read, a notice when the run judges only a part by design (`--diff`, `--component`, `--scope`) and a notice when the indexes came from the cache) and `junit` (a failed test case per violation). `sarif` gives what a run leaves out (the narrowing, each evidence gap with its files, the cache) as notifications of its invocation, errors under `--require-evidence`; `junit` gives them in ``, and under `--require-evidence` a failed test case per evidence gap. +`--format` picks the report: `text` (default), `json`, `sarif` (GitHub Code Scanning), `github` (annotations on the changed files) and `junit` (a failed test case per violation). Each note a run makes of itself has one kind, which every format names alike: `narrowed` (the run judges only a part by design: `--diff`, `--component`, `--scope`), `evidence-gap` (code the check could not read or judge), `accepted-gap` (an `uncovered_ok` entry, with its reason and files), `unused-allowance` (under `--suggest`) and `cache` (the indexes came from the cache). `github` titles each annotation `easement `: a narrowing, an accepted gap (one per `uncovered_ok` entry) and the cache are notices, an evidence gap a warning, or an error under `--require-evidence`. `sarif` gives them as notifications of its invocation, each with its kind as `descriptor.id` (declared in `tool.driver.notifications`) and its files as locations, evidence gaps as errors under `--require-evidence`. `junit` gives them in ``, each line opening with its kind (`narrowed: …`, `evidence gap: …; to close: …`, `accepted gap (uncovered_ok: …) because …; files: …`), and under `--require-evidence` a failed test case per evidence gap; an accepted gap is never a failed test case. The repository is a GitHub Action: diff --git a/docs/configuration.md b/docs/configuration.md index 6792c66..0964d58 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -349,7 +349,7 @@ rules: - { name: "db.Client", because: use db.Scoped so every query is tenant-bound } ``` -`forbid_symbol` names what a component must not use, as `module.Name`: the module by its whole path or by the end of it, cut where its language cuts module names, in every language alike (`example.com/app/tags.DeleteIn` or `tags.DeleteIn` in Go, `app::db::client::Client` or `client::Client` in Rust, `app.db.client.Client` or `client.Client` in Python); a short end may match several modules, and the item covers each. A member of a type (a method, a variant, a constant) follows the type it is used through: `db.Client.Query` in Go, `std::sync::atomic::Ordering.Relaxed` in Rust, `Shop::Db::Client.query` in Ruby. `public_symbols` is the other side: other components may use only these names from the component's packages (`only Scoped and Tx`). Both are `symbol` violations at the line of the use and can be suppressed inline. A `forbid_symbol` name that matches no symbol of the index, while one of the same name is defined in a namespace under its qualifier (`I18n.locale` is defined as `I18n::Base.locale`), can never fire, so it fails as `unmatched` at its line in the policy, with the name it probably means, as an `in` pattern that matches no file does. A name the index has never seen stays silent, since forbidding what the code does not use yet is what the rule is for; and nothing is said while the index is partial. +`forbid_symbol` names what a component must not use, as `module.Name`: the module by its whole path or by the end of it, cut where its language cuts module names, in every language alike (`example.com/app/tags.DeleteIn` or `tags.DeleteIn` in Go, `app::db::client::Client` or `client::Client` in Rust, `app.db.client.Client` or `client.Client` in Python); a short end may match several modules, and the item covers each. A member of a type (a method, a variant, a constant) follows the type it is used through: `db.Client.Query` in Go, `std::sync::atomic::Ordering.Relaxed` in Rust, `Shop::Db::Client.query` in Ruby. `public_symbols` is the other side: other components may use only these names from the component's packages (`only Scoped and Tx`). Both are `symbol` violations at the line of the use and can be suppressed inline. A `forbid_symbol` name that matches no symbol of the index, while one of the same name is defined in a namespace under its qualifier (`I18n.locale` is defined as `I18n::Base.locale`), can never fire, so it fails as `unmatched` at its line in the policy, with the name it probably means, as an `in` pattern that matches no file does. A name the index has never seen stays silent, since forbidding what the code does not use yet is what the rule is for; and nothing is said while an evidence gap leaves the index short. A top-level `forbid_symbol` of the same shape applies to every checked file: components and the files that belong to no component (`unowned` in `strict` mode) alike, and a component's own list adds to it. Write a name forbidden across the project once, instead of in every rule: diff --git a/docs/languages.md b/docs/languages.md index cc7c799..84f3027 100644 --- a/docs/languages.md +++ b/docs/languages.md @@ -76,7 +76,7 @@ Indexers are slow (a second or two for a small project, ten or more for a big on - **Kept:** the newest 32 indexes of each directory and indexer, and 4 GiB in all: past that the least recently used indexes go, whatever directory they belong to. - **Not looked at:** dependencies outside the project (`node_modules`, `vendor/`, the Go module cache, the Python environment: `.venv`, `venv`, `.tox`, `.nox`), and the toolchain an indexer calls on the `PATH` (`go`, `python3`, `dotnet`, the JDK, Maven). After changing them without touching a lock file, run `easement check --no-cache`. An indexer run through rustup or a mise shim is known by the binary that rustup or mise runs in the directory of the index; other proxies (Volta, proto) are not resolved, so after switching a toolchain behind them run `--no-cache` too. -`--format json` reports `stats.indexed` and `stats.from_cache`. When an index came from the cache, the report says so, in `cached` of `--format json` and in a line of the text, with what the key leaves out and that `--no-cache` indexes again. Every command that reads the indexes (`check`, `baseline`, `impact`, `why`, `suggest`, `graph`, `review`, `propose`, `init`) takes `--no-cache` and `--cache-only`. `impact` (`cached` in its JSON), `why`, `suggest` and `baseline` say it the same way; `graph` and `suggest --patch`, whose output is a diagram or a patch, say it on stderr, with `graph` naming there the reasons its graph may be partial too. +`--format json` reports `stats.indexed` and `stats.from_cache`. When an index came from the cache, the report says so, in `cached` of `--format json` and in a line of the text, with what the key leaves out and that `--no-cache` indexes again. Every command that reads the indexes (`check`, `baseline`, `impact`, `why`, `suggest`, `graph`, `review`, `propose`, `init`) takes `--no-cache` and `--cache-only`. `impact` (`cached` in its JSON), `why`, `suggest` and `baseline` say it the same way; `graph` and `suggest --patch`, whose output is a diagram or a patch, say it on stderr, with `graph` listing there, as every other command does, the evidence gaps that leave dependencies out of the drawing (with how to close each and its files) and the accepted gaps with their reasons: an accepted file is unread all the same, so a drawing without its dependencies counts it as both. `--cache-only` runs no indexer and exits 3 when an index is not cached. `easement doctor --cache` asks the same of the cache without a check: it says, per index, whether it is cached and why not, and exits 3 on a miss. A CI job can call it first and set up an indexer's toolchain (the Go module cache, `npm install`) only on a miss; the dependencies an indexer needs are checked only when it runs, since a cached index was written with them in place. diff --git a/easement.schema.json b/easement.schema.json index f99d0c2..a4db8b5 100644 --- a/easement.schema.json +++ b/easement.schema.json @@ -179,7 +179,7 @@ ] }, "uncovered_ok": { - "description": "Source files that no indexer covers and that may stay that way (globs, each with the reason). Others are listed in the report as not covered, and the result is marked partial.", + "description": "Source files that no indexer covers and that may stay that way (globs, each with the reason): accepted gaps, still listed in the report. Others are evidence gaps.", "type": "array", "items": { "$ref": "#/definitions/Accepted" diff --git a/skills/easement/SKILL.md b/skills/easement/SKILL.md index 18908ce..8166879 100644 --- a/skills/easement/SKILL.md +++ b/skills/easement/SKILL.md @@ -26,7 +26,7 @@ Run `easement check`. It exits 0 when the code matches the config, 1 on violatio - `--format json` gives the same report as data. `narrowed` lists what you asked to judge alone (`--diff`, `--component`, `--scope`). `evidence_gaps` lists code the check could not read or judge, each with its files, the place of each part where it knows them (`places`: `file`, `line`, `specifier`), and how to close it: a pass says nothing about that code, so say so and name the files. `accepted_gaps` lists files `uncovered_ok` accepts, with its reason: they are unread too, but by decision. `suppressions` lists each inline suppression the run honoured, at its directive, with the violations it `excused`: they do not fail, but one your change relies on is listed, so name it in your summary. When `cached` is set, the indexes came from the cache; after changing dependencies outside the project without a lock file, run `easement check --no-cache`. - On exit 2, read the message. For a missing indexer or missing dependencies, run `easement doctor`. - When your change touches the policy (`easement.yml`, a file it extends, its diagram, the baseline), run `easement review --base ` and put what it says in the pull request: the pairs of components newly permitted or rejected, the surfaces widened, the baseline entries and `exclude`, `uncovered_ok` or `warn` entries added. It always exits 0; `check` is the gate. -- `easement impact --diff ` lists every file that depends on your change, the nearest first, each with the shortest chain of imports from it to the changed file it reaches: run the tests among them, the nearest first. When it says `Partial`, files no indexer read or files the change deletes may hide more. `Cached:` means the indexes came from the cache; `--no-cache` indexes again. +- `easement impact --diff ` lists every file that depends on your change, the nearest first, each with the shortest chain of imports from it to the changed file it reaches: run the tests among them, the nearest first. When it lists `Evidence gaps`, files no indexer read or files the change deletes may hide more; files listed under `Accepted gaps` are unread too. `Cached:` means the indexes came from the cache; `--no-cache` indexes again. ## When the check fails diff --git a/src/commands.rs b/src/commands.rs index 35045f8..5f2cef6 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -7,7 +7,7 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result}; use crate::baseline::{Baseline, Verdict}; -use crate::components::ComponentMap; +use crate::components::{AcceptedGap, ComponentMap}; use crate::policy::Policy; use crate::project::{self, Analysis, Project}; use crate::{ @@ -481,11 +481,36 @@ pub fn policy(config: &Path) -> Result { } /// A drawing of the components and the dependencies between them, with what -/// it leaves out apart from it. +/// it leaves out apart from it. `--focus` narrows nothing: the drawing shows +/// what it draws. pub struct Drawn { pub diagram: String, - /// The evidence gaps and the cache note, for a channel other than the diagram's. - pub notes: Vec, + /// The gaps that leave dependencies out of the drawing, every file no + /// indexer read among them, `uncovered_ok` or not. + pub evidence_gaps: Vec, + /// Files no indexer read that `uncovered_ok` accepts, by the entry that accepts them. + pub accepted_gaps: Vec, + /// Set when indexes came from the cache: what their key leaves out and how + /// to index again. + pub cached: Option, +} + +impl Drawn { + /// What the drawing leaves out, for a channel other than the diagram's: the + /// gaps as every command says them, then the cache note. + pub fn notes(&self) -> String { + let mut out = report::gap_lines( + &self.evidence_gaps, + &self.accepted_gaps, + "an arrow through this code may be missing from the drawing", + false, + false, + ); + if let Some(note) = &self.cached { + out.push_str(&format!("easement: {note}\n")); + } + out + } } /// Draws the components, or only `focus` and the ones it shares an arrow with. @@ -500,11 +525,6 @@ pub fn graph( project.config().require_component(name)?; } let analysis = project.analyze(cache)?; - let notes = report::evidence_gaps(&analysis.stats) - .into_iter() - .map(|gap| format!("partial: {}", gap.message)) - .chain(report::cache_note(&analysis.stats)) - .collect(); Ok(Drawn { diagram: graph::render( format, @@ -513,7 +533,9 @@ pub fn graph( &analysis.violations, focus, ), - notes, + evidence_gaps: report::graph_gaps(&analysis.stats, &analysis.unindexed), + cached: report::cache_note(&analysis.stats), + accepted_gaps: analysis.accepted, }) } diff --git a/src/config/mod.rs b/src/config/mod.rs index cf05755..94e2c5a 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -105,8 +105,7 @@ pub struct Config { #[serde(default)] pub unowned: Vec, /// Source files that no indexer covers and that may stay that way (globs, each with the - /// reason). Others are listed in the report as not covered, and the result is marked - /// partial. + /// reason): accepted gaps, still listed in the report. Others are evidence gaps. #[serde(default)] pub uncovered_ok: Vec, /// Settings of an indexer, by the language it reads: `go: { tags: [race] }` indexes Go diff --git a/src/main.rs b/src/main.rs index 1021870..e320c11 100644 --- a/src/main.rs +++ b/src/main.rs @@ -443,9 +443,7 @@ fn run(cli: Cli) -> Result { } => { let drawn = commands::graph(&config, format, focus.as_deref(), &mut cache(flags))?; // On stderr: stdout is the diagram itself. - for note in &drawn.notes { - eprintln!("easement: {note}"); - } + eprint!("{}", drawn.notes()); print!("{}", drawn.diagram); Ok(Outcome::Passed) } diff --git a/src/propose.rs b/src/propose.rs index 79dc76e..23d2db2 100644 --- a/src/propose.rs +++ b/src/propose.rs @@ -804,10 +804,9 @@ impl Report { Some(_) => format!("{failing} failing graph consequence(s)"), None => "graph not judged".to_string(), }, - if self.coverage.confidence() == report::Confidence::Partial { - " (partial)" - } else { - "" + match self.coverage.summary() { + reasons if reasons.is_empty() => String::new(), + reasons => format!(" ({reasons})"), } )); out diff --git a/src/report.rs b/src/report.rs index 37d4833..b668af6 100644 --- a/src/report.rs +++ b/src/report.rs @@ -63,15 +63,6 @@ struct DiffInfo<'a> { in_full: &'a [InFull], } -/// How much of the project an answer covers. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] -#[serde(rename_all = "lowercase")] -pub enum Confidence { - Full, - /// It rests on code no indexer read, or judges only a part by design. - Partial, -} - /// What an answer leaves out: the part it was asked to judge, the code it could /// not read or judge, and the gaps the policy accepts. A cache hit is none of them. #[derive(Debug, Default, Serialize)] @@ -196,6 +187,18 @@ impl GapKind { } } +impl Narrowing { + /// The flag that asked for it, as it is written: `--diff main`, `--no-graph`. + fn flag(&self) -> String { + match self.kind { + NarrowingKind::Diff => format!("--diff {}", self.limited_to), + NarrowingKind::Component => format!("--component {}", self.limited_to), + NarrowingKind::Scope => format!("--scope {}", self.limited_to), + NarrowingKind::NoGraph => "--no-graph".to_string(), + } + } +} + /// The parts that `--diff`, `--component` and `--scope` narrow a check to. pub fn narrowed( changes: Option<&Changes>, @@ -256,7 +259,7 @@ pub fn evidence_gaps(stats: &Stats) -> Vec { } /// The evidence gaps of a run that leave dependencies out of its graph, for an -/// answer about the graph (`impact`, `why`). `unread` is every file no indexer +/// answer about the graph (`impact`, `why`, `suggest`, `graph`). `unread` is every file no indexer /// read, `uncovered_ok` or not: accepting a file settles the verdict of `check`, /// but nobody saw its imports. pub fn graph_gaps(stats: &Stats, unread: &[String]) -> Vec { @@ -415,14 +418,22 @@ impl Coverage { } } - /// `partial` when the answer is narrowed or has an evidence gap; an - /// accepted gap alone leaves it `full`. - pub fn confidence(&self) -> Confidence { - if self.narrowed.is_empty() && self.evidence_gaps.is_empty() { - Confidence::Full - } else { - Confidence::Partial + /// What the answer leaves out, in one clause for a summary line: the + /// narrowing by the flags that asked for it, then how many evidence gaps + /// (`narrowed: --no-graph; 1 evidence gap`); empty when it leaves out + /// nothing. Accepted gaps are said apart, with their reasons. + pub fn summary(&self) -> String { + let mut reasons = Vec::new(); + if !self.narrowed.is_empty() { + let flags: Vec = self.narrowed.iter().map(Narrowing::flag).collect(); + reasons.push(format!("narrowed: {}", flags.join(", "))); + } + match self.evidence_gaps.len() { + 0 => {} + 1 => reasons.push("1 evidence gap".to_string()), + n => reasons.push(format!("{n} evidence gaps")), } + reasons.join("; ") } /// One sentence for `--diff`, and one for `--component` and `--scope` together. @@ -486,8 +497,8 @@ fn diff_header(diff: &Diff) -> String { out } -/// What a verdict over cached indexes rests on. Not a reason for `partial`: the -/// key holds what decides an index, but not dependencies outside the project. +/// What a verdict over cached indexes rests on. Neither a narrowing nor a gap: +/// the key holds what decides an index, but not dependencies outside the project. pub fn cache_note(stats: &Stats) -> Option { cache_note_of(stats.from_cache) } @@ -918,16 +929,96 @@ fn stale_message(k: &Key) -> String { ) } +/// The kind of a note a run makes of itself beside its results. Every format +/// names it the same way: the GitHub annotation title (`easement evidence-gap`), +/// the SARIF notification descriptor, the prefix in JUnit's ``. +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +enum NoteKind { + Narrowed, + EvidenceGap, + AcceptedGap, + UnusedAllowance, + Cache, +} + +impl NoteKind { + fn id(self) -> &'static str { + match self { + NoteKind::Narrowed => "narrowed", + NoteKind::EvidenceGap => "evidence-gap", + NoteKind::AcceptedGap => "accepted-gap", + NoteKind::UnusedAllowance => "unused-allowance", + NoteKind::Cache => "cache", + } + } + + /// The title of its GitHub annotation, and the description of its SARIF descriptor. + fn title(self) -> String { + format!("easement {}", self.id()) + } +} + +/// A note a run makes of itself: its kind, its level, its text and the files it names. +struct Note<'a> { + kind: NoteKind, + level: ResultLevel, + text: String, + files: &'a [String], + /// Its line in JUnit's ``, which opens with its kind. + out: String, +} + +impl<'a> Note<'a> { + fn new(kind: NoteKind, level: ResultLevel, text: String, files: &'a [String]) -> Self { + let out = format!("{}: {text}", kind.id().replace('-', " ")); + Note { + kind, + level, + text, + files, + out, + } + } + + /// An `uncovered_ok` entry: its globs, its reason and its files. + fn accepted(gap: &'a AcceptedGap) -> Self { + let globs = gap.uncovered_ok.join(", "); + let files = gap.files.join(", "); + let because = gap.because.as_deref().map(|b| format!(" because {b}")); + let because = because.as_deref().unwrap_or_default(); + Note { + out: format!("accepted gap (uncovered_ok: {globs}){because}; files: {files}"), + ..Note::new( + NoteKind::AcceptedGap, + ResultLevel::Note, + accepted_message(gap), + &gap.files, + ) + } + } +} + +/// What an `uncovered_ok` entry accepts, in one line. +fn accepted_message(gap: &AcceptedGap) -> String { + let because = gap.because.as_deref().map(|b| format!(", because {b}")); + format!( + "uncovered_ok: {} accepts files no indexer read{}; their dependencies were not checked; files: {}", + gap.uncovered_ok.join(", "), + because.as_deref().unwrap_or_default(), + gap.files.join(", ") + ) +} + impl Report<'_> { /// What a run says of itself beside its results, in the order the text gives /// it: the narrowing, the evidence gaps (errors under `--require-evidence`), - /// and the cache. Each is (level, text, files). - fn notes(&self) -> Vec<(ResultLevel, String, &[String])> { - let mut notes: Vec<(ResultLevel, String, &[String])> = self + /// the accepted gaps, the unused allowances and the cache. + fn notes(&self) -> Vec> { + let mut notes: Vec> = self .coverage .narrowed_reasons() .into_iter() - .map(|reason| (ResultLevel::Note, reason, &[][..])) + .map(|reason| Note::new(NoteKind::Narrowed, ResultLevel::Note, reason, &[])) .collect(); let level = gap_level(self.require_evidence); for gap in &self.coverage.evidence_gaps { @@ -935,16 +1026,17 @@ impl Report<'_> { if !gap.files.is_empty() { text.push_str(&format!("; files: {}", gap.files.join(", "))); } - notes.push((level, text, &gap.files)); + notes.push(Note::new(NoteKind::EvidenceGap, level, text, &gap.files)); } + notes.extend(self.coverage.accepted_gaps.iter().map(Note::accepted)); notes.extend( self.spared .notes() .into_iter() - .map(|note| (ResultLevel::Note, note, &[][..])), + .map(|note| Note::new(NoteKind::UnusedAllowance, ResultLevel::Note, note, &[])), ); if let Some(note) = cache_note(self.stats) { - notes.push((ResultLevel::Note, note, &[][..])); + notes.push(Note::new(NoteKind::Cache, ResultLevel::Note, note, &[])); } notes } @@ -952,27 +1044,12 @@ impl Report<'_> { /// SARIF 2.1.0, the format GitHub Code Scanning ingests: the violations as /// results, and what the run leaves out as notifications of its invocation. pub fn sarif(&self) -> String { - let notifications: Vec<_> = self - .notes() - .into_iter() - .map(|(level, text, files)| { - sarif::Notification::builder() - .level(serde_json::Value::from(level.to_string())) - .message(sarif_message(text)) - .locations( - files - .iter() - .map(|file| sarif_location(file, None)) - .collect::>(), - ) - .build() - }) - .collect(); - sarif(self.verdict, notifications) + sarif(self.verdict, self.notes()) } /// JUnit XML: one failed test case per violation, and under `--require-evidence` - /// per evidence gap; what the run leaves out also in ``. + /// per evidence gap; what the run leaves out also in ``, each + /// note opening with its kind. An accepted gap is never a failed test case. pub fn junit(&self) -> String { let gaps: Vec<(String, String)> = if self.require_evidence { self.coverage @@ -983,13 +1060,50 @@ impl Report<'_> { } else { Vec::new() }; - let out: Vec = self.notes().into_iter().map(|(_, text, _)| text).collect(); + let out: Vec = self.notes().into_iter().map(|note| note.out).collect(); junit(self.verdict, &gaps, &out) } } -/// SARIF 2.1.0 of a verdict, with what the run says of itself. -fn sarif(verdict: &Verdict, notifications: Vec) -> String { +/// SARIF 2.1.0 of a verdict, with what the run says of itself: each note a +/// notification whose descriptor is its kind, each kind declared once. +fn sarif(verdict: &Verdict, notes: Vec>) -> String { + let mut kinds: Vec = notes.iter().map(|note| note.kind).collect(); + kinds.sort_unstable(); + kinds.dedup(); + let declared: Vec<_> = kinds + .into_iter() + .map(|kind| { + sarif::ReportingDescriptor::builder() + .id(kind.id()) + .short_description( + sarif::MultiformatMessageString::builder() + .text(kind.title()) + .build(), + ) + .build() + }) + .collect(); + let notifications: Vec<_> = notes + .into_iter() + .map(|note| { + sarif::Notification::builder() + .level(serde_json::Value::from(note.level.to_string())) + .message(sarif_message(note.text)) + .descriptor( + sarif::ReportingDescriptorReference::builder() + .id(note.kind.id()) + .build(), + ) + .locations( + note.files + .iter() + .map(|file| sarif_location(file, None)) + .collect::>(), + ) + .build() + }) + .collect(); let mut ids: Vec<&str> = verdict .new .iter() @@ -1049,12 +1163,14 @@ fn sarif(verdict: &Verdict, notifications: Vec) -> String { .message(sarif_message(stale_message(k))) .build() })); - let driver = sarif::ToolComponent::builder() + let mut driver = sarif::ToolComponent::builder() .name("easement") .version(env!("CARGO_PKG_VERSION")) .information_uri(env!("CARGO_PKG_HOMEPAGE")) .rules(rules) .build(); + // A run that says nothing of itself declares no kind. + driver.notifications = (!declared.is_empty()).then_some(declared); let invocation = sarif::Invocation::builder() .execution_successful(true) .tool_execution_notifications(notifications) @@ -1188,7 +1304,7 @@ impl Report<'_> { for note in spared.notes() { out.push_str(&format!( "::notice title={}::{}\n", - escape_property("easement unused-allowance"), + escape_property(&NoteKind::UnusedAllowance.title()), escape_command(¬e) )); } @@ -1215,7 +1331,7 @@ impl Report<'_> { let narrowed = coverage .narrowed_reasons() .into_iter() - .map(|reason| (ResultLevel::Note, reason)); + .map(|reason| (NoteKind::Narrowed, ResultLevel::Note, reason)); for part in diff.iter().flat_map(|d| &d.attribution.in_full) { out.push_str(&format!( "::notice title={}::{}\n", @@ -1227,19 +1343,27 @@ impl Report<'_> { let gaps = coverage .evidence_gaps .iter() - .map(|gap| (level, gap.message.clone())); - for (level, reason) in narrowed.chain(gaps) { + .map(|gap| (NoteKind::EvidenceGap, level, gap.message.clone())); + // One notice per `uncovered_ok` entry, not one per file it accepts. + let accepted = coverage.accepted_gaps.iter().map(|gap| { + ( + NoteKind::AcceptedGap, + ResultLevel::Note, + accepted_message(gap), + ) + }); + for (kind, level, reason) in narrowed.chain(gaps).chain(accepted) { out.push_str(&format!( "::{} title={}::{}\n", workflow_command(level), - escape_property("easement partial"), + escape_property(&kind.title()), escape_command(&reason) )); } if let Some(note) = cache_note(stats) { out.push_str(&format!( "::notice title={}::{}\n", - escape_property("easement cache"), + escape_property(&NoteKind::Cache.title()), escape_command(¬e) )); } @@ -1519,6 +1643,12 @@ mod tests { .len(), 2 ); + // Nothing said of the run, no kind of note declared. + assert!( + report["runs"][0]["tool"]["driver"] + .get("notifications") + .is_none() + ); } #[test] @@ -1685,22 +1815,143 @@ hi accepted_gaps: accepted, ..Coverage::default() }; - assert_eq!(coverage.confidence(), Confidence::Full); assert!(coverage.narrowed_reasons().is_empty()); - let out = Report { - verdict: &verdict(), - stats: &Stats::default(), + assert!(coverage.summary().is_empty()); + let (verdict, stats) = (verdict(), Stats::default()); + let report = |require_evidence| Report { + verdict: &verdict, + stats: &stats, coverage: &coverage, diff: None, drift: None, - require_evidence: false, + require_evidence, spared: &NO_SPARED, - } - .text(); + }; + let out = report(false).text(); assert!( out.contains(" gen/**, tools/** because: generated\n gen/b.go\n tools/a.go\n"), "{out}" ); + // One notice per `uncovered_ok` entry, with its globs, its reason and its files. + let github = report(true).github(); + assert_eq!( + github + .lines() + .filter(|l| l.contains("title=easement accepted-gap")) + .collect::>(), + [ + "::notice title=easement accepted-gap::uncovered_ok: gen/**, tools/** accepts files no indexer read, because generated; their dependencies were not checked; files: gen/b.go, tools/a.go" + ], + "{github}" + ); + } + + /// An accepted gap is a note in SARIF and in JUnit's ``, never a + /// failed test case, with `--require-evidence` or not. + #[test] + fn sarif_and_junit_say_an_accepted_gap_as_a_note() { + let coverage = Coverage { + accepted_gaps: vec![AcceptedGap { + uncovered_ok: vec!["tools/**".into()], + because: Some("generated".into()), + files: vec!["tools/a.go".into()], + }], + ..Coverage::default() + }; + let clean = clean_verdict(); + for require_evidence in [false, true] { + let report = Report { + verdict: &clean, + stats: &Stats::default(), + coverage: &coverage, + diff: None, + drift: None, + require_evidence, + spared: &NO_SPARED, + }; + let sarif: serde_json::Value = serde_json::from_str(&report.sarif()).unwrap(); + let run = &sarif["runs"][0]; + let said = &run["invocations"][0]["toolExecutionNotifications"]; + assert_eq!(said.as_array().unwrap().len(), 1, "{said}"); + assert_eq!(said[0]["level"], "note"); + assert_eq!(said[0]["descriptor"]["id"], "accepted-gap"); + assert_eq!( + said[0]["locations"][0]["physicalLocation"]["artifactLocation"]["uri"], + "tools/a.go" + ); + assert_eq!( + run["tool"]["driver"]["notifications"], + serde_json::json!([{ + "id": "accepted-gap", + "shortDescription": { "text": "easement accepted-gap" }, + }]) + ); + let xml = report.junit(); + assert!(xml.contains("failures=\"0\""), "{xml}"); + assert!( + xml.contains( + "accepted gap (uncovered_ok: tools/**) because generated; files: tools/a.go" + ), + "{xml}" + ); + } + } + + /// `propose` sums up what its answer leaves out by kind, never as `partial`. + #[test] + fn the_summary_names_the_narrowing_and_counts_the_evidence_gaps() { + let gap = |message: &str| { + EvidenceGap::of(GapKind::StdUnknown, &Unjudged::new(message.into()), "close") + }; + let no_graph = Narrowing { + kind: NarrowingKind::NoGraph, + limited_to: "dependency decisions".into(), + }; + let narrowed = Coverage { + narrowed: vec![no_graph.clone()], + ..Coverage::default() + }; + assert_eq!(narrowed.summary(), "narrowed: --no-graph"); + let gaps = Coverage { + evidence_gaps: vec![gap("a"), gap("b")], + ..Coverage::default() + }; + assert_eq!(gaps.summary(), "2 evidence gaps"); + let both = Coverage { + narrowed: vec![ + no_graph, + Narrowing { + kind: NarrowingKind::Diff, + limited_to: "main".into(), + }, + Narrowing { + kind: NarrowingKind::Component, + limited_to: "web".into(), + }, + Narrowing { + kind: NarrowingKind::Scope, + limited_to: "src/api".into(), + }, + ], + evidence_gaps: vec![gap("a")], + ..Coverage::default() + }; + assert_eq!( + both.summary(), + "narrowed: --no-graph, --diff main, --component web, --scope src/api; 1 evidence gap" + ); + } + + fn clean_verdict() -> Verdict { + Verdict { + new: vec![], + warnings: vec![], + owners: BTreeMap::new(), + stale: vec![], + legalized: 0, + suppressions: vec![], + warned: Default::default(), + } } #[test] @@ -1722,7 +1973,6 @@ hi ], ..Coverage::default() }; - assert_eq!(coverage.confidence(), Confidence::Partial); assert_eq!( coverage.narrowed_reasons(), [ @@ -1760,7 +2010,7 @@ hi assert!(report(false).passed()); let github = report(false).github(); assert!( - github.contains("::warning title=easement partial::"), + github.contains("::warning title=easement evidence-gap::"), "{github}" ); assert!(github.contains("easement passed"), "{github}"); @@ -1768,7 +2018,7 @@ hi assert!(!report(true).passed()); let github = report(true).github(); assert!( - github.contains("::error title=easement partial::"), + github.contains("::error title=easement evidence-gap::"), "{github}" ); assert!(github.contains("easement failed"), "{github}"); @@ -1833,6 +2083,21 @@ hi assert_eq!(said[1].0, "warning"); assert!(said[1].1.contains("tools/gen.go"), "{said:?}"); assert!(said[2].1.contains("--no-cache"), "{said:?}"); + // The kind of each note tells a narrowing from a gap, not only the level. + let kinds: Vec<&str> = sarif["runs"][0]["invocations"][0]["toolExecutionNotifications"] + .as_array() + .unwrap() + .iter() + .map(|n| n["descriptor"]["id"].as_str().unwrap()) + .collect(); + assert_eq!(kinds, ["narrowed", "evidence-gap", "cache"]); + let declared: Vec<&str> = sarif["runs"][0]["tool"]["driver"]["notifications"] + .as_array() + .unwrap() + .iter() + .map(|n| n["id"].as_str().unwrap()) + .collect(); + assert_eq!(declared, ["narrowed", "evidence-gap", "cache"]); let required: serde_json::Value = serde_json::from_str(&report(true).sarif()).unwrap(); assert_eq!( required["runs"][0]["invocations"][0]["toolExecutionNotifications"][1]["level"], @@ -1840,9 +2105,21 @@ hi ); let xml = report(false).junit(); - assert!(xml.contains(""), "{xml}"); - assert!(xml.contains("tools/gen.go"), "{xml}"); - assert!(xml.contains("--no-cache"), "{xml}"); + assert!( + xml.contains("narrowed: the report is limited to component web"), + "{xml}" + ); + assert!( + xml.contains( + "\nevidence gap: 1 source files were not covered by an indexer, so the dependencies in or on them were not checked; to close: " + ), + "{xml}" + ); + assert!(xml.contains("; files: tools/gen.go\n"), "{xml}"); + assert!( + xml.contains("\ncache: 1 index(es) came from the cache"), + "{xml}" + ); assert!(xml.contains("failures=\"0\""), "{xml}"); // Under `--require-evidence` a gap fails the run, so it is a failed test case. let xml = report(true).junit(); @@ -1851,7 +2128,7 @@ hi } #[test] - fn github_says_why_a_verdict_is_partial_and_when_it_was_cached() { + fn github_names_the_narrowing_the_gaps_and_the_cache_apart() { let stats = Stats { from_cache: 1, uncovered: vec!["tools/gen.go".into()], @@ -1869,7 +2146,7 @@ hi .github(); assert!( out.contains( - "::warning title=easement partial::1 source files were not covered by an indexer" + "::warning title=easement evidence-gap::1 source files were not covered by an indexer" ), "{out}" ); @@ -1910,7 +2187,9 @@ hi } .github(); assert!( - out.contains("::notice title=easement partial::the report is limited to component web"), + out.contains( + "::notice title=easement narrowed::the report is limited to component web" + ), "{out}" ); assert!(!out.contains("::warning"), "{out}"); diff --git a/tests/cli.rs b/tests/cli.rs index 99d787c..5c91af0 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -602,4 +602,13 @@ fn graph_and_suggest_patch_print_their_notes_on_stderr() { .success() .stdout(contains("came from the cache").not()) .stderr(contains("came from the cache")); + // So do the gaps that leave dependencies out of the drawing. + let (_tmp, root) = fixture("uncovered"); + easement_cached(&root, &["graph"], cache.path()) + .success() + .stdout(contains("Evidence gaps").not()) + .stderr(contains( + "Evidence gaps (an arrow through this code may be missing from the drawing):\n", + )) + .stderr(contains(" tools/gen.go\n")); } diff --git a/tests/library/answers.rs b/tests/library/answers.rs index 8444d93..5c714fb 100644 --- a/tests/library/answers.rs +++ b/tests/library/answers.rs @@ -373,12 +373,9 @@ fn every_command_says_when_its_indexes_came_from_the_cache() { drawn.diagram ); assert!( - drawn - .notes - .iter() - .any(|note| note.contains("came from the cache")), - "{:?}", - drawn.notes + drawn.notes().contains("came from the cache"), + "{}", + drawn.notes() ); let recorded = commands::baseline(&config, false, &mut own()).unwrap(); assert_eq!(recorded.outcome(), Outcome::Passed); diff --git a/tests/library/evidence.rs b/tests/library/evidence.rs index 59ea5c5..99d479a 100644 --- a/tests/library/evidence.rs +++ b/tests/library/evidence.rs @@ -7,7 +7,7 @@ use std::fs; use std::path::Path; use easement::commands::{self, CheckOptions, Checked, Outcome, Proposed}; -use easement::{CacheUse, Coverage, GapKind, Place}; +use easement::{CacheUse, Coverage, GapKind, GraphFormat, Place}; use tempfile::TempDir; use crate::common::{commit_all, fixture, project}; @@ -262,7 +262,7 @@ fn add_to_policy(root: &Path, text: &str) { } #[test] -fn uncovered_files_are_listed_and_the_verdict_says_it_is_partial() { +fn uncovered_files_are_listed_as_an_evidence_gap() { let (_tmp, root) = fixture("uncovered"); let checked = check(&root); assert_eq!(checked.outcome(), Outcome::Passed); @@ -407,6 +407,27 @@ uncovered_ok: "files": ["app/race.go"], }]) ); + // A drawing without the dependencies of the accepted file says so beside it. + let drawn = commands::graph(&config, GraphFormat::Mermaid, None, &mut cache()).unwrap(); + let notes = drawn.notes(); + assert!( + notes.contains( + "Evidence gaps (an arrow through this code may be missing from the drawing):\n" + ), + "{notes}" + ); + assert!(notes.contains(" to close: "), "{notes}"); + assert!(notes.contains(" app/race.go\n"), "{notes}"); + assert!(notes.contains("Accepted gaps (`uncovered_ok`"), "{notes}"); + assert!( + notes.contains(" app/race.go because: race-only helpers\n"), + "{notes}" + ); + assert!( + !drawn.diagram.contains("Evidence gaps"), + "{}", + drawn.diagram + ); } /// `--require-evidence` fails a pass that rests on code the check could not read, diff --git a/tests/library/externals.rs b/tests/library/externals.rs index 77eca23..c5b6cad 100644 --- a/tests/library/externals.rs +++ b/tests/library/externals.rs @@ -4,9 +4,11 @@ use std::fs; use easement::commands::{self, Outcome}; +use easement::{CacheUse, GraphFormat}; +use tempfile::TempDir; use crate::common::{commit_all, fixture, git, project, stub_packages}; -use crate::run::{cache, check, config, json, parse, pinned, text}; +use crate::run::{cache, cache_in, check, config, json, parse, pinned, text}; #[test] fn a_top_level_forbidden_module_may_be_used_only_by_the_components_and_paths_it_allows() { @@ -273,6 +275,12 @@ fn a_top_level_std_item_over_a_file_of_no_component_it_cannot_judge_is_a_gap() { .contains("`$std` cannot tell the standard library of .ts files"), "{report}" ); + // The gap leaves a rule unjudged, not an arrow out of the drawing; indexed + // afresh, the drawing has nothing to say beside it. + let own = TempDir::new().unwrap(); + let mut fresh = cache_in(own.path(), CacheUse::On); + let drawn = commands::graph(&config(&root), GraphFormat::Mermaid, None, &mut fresh).unwrap(); + assert_eq!(drawn.notes(), ""); } /// Only a policy that names `$std` needs to tell the standard library: without it, a diff --git a/tests/library/formats.rs b/tests/library/formats.rs index 2ea6e80..bc6d363 100644 --- a/tests/library/formats.rs +++ b/tests/library/formats.rs @@ -1,12 +1,14 @@ //! The report of `check` in the formats a CI reads: GitHub annotations, //! SARIF and JUnit. -use easement::CacheUse; -use easement::commands::{self, CheckOptions, Outcome}; +use std::fs; + +use easement::commands::{self, CheckOptions, Outcome, Proposed}; +use easement::{CacheUse, GraphFormat}; use tempfile::TempDir; -use crate::common::fixture; -use crate::run::{cache_in, check, config, parse, pinned}; +use crate::common::{commit_all, fixture}; +use crate::run::{cache, cache_in, check, check_with, config, parse, pinned}; #[test] fn the_report_reads_in_every_ci_format() { @@ -51,3 +53,204 @@ fn the_junit_report_is_pinned() { let junit = checked.report().junit(); pinned(|| insta::assert_snapshot!("junit_report", junit)); } + +/// The SARIF notifications of a report, as (descriptor id, level, files). +fn notifications(sarif: &str) -> Vec<(String, String, Vec)> { + parse(sarif)["runs"][0]["invocations"][0]["toolExecutionNotifications"] + .as_array() + .unwrap() + .iter() + .map(|n| { + let files = n["locations"] + .as_array() + .into_iter() + .flatten() + .map(|l| { + l["physicalLocation"]["artifactLocation"]["uri"] + .as_str() + .unwrap() + .to_string() + }) + .collect(); + ( + n["descriptor"]["id"].as_str().unwrap().to_string(), + n["level"].as_str().unwrap().to_string(), + files, + ) + }) + .collect() +} + +/// The `uncovered` fixture, its tools accepted in `uncovered_ok` but `except`. +fn accepting_tools(except: &str) -> (TempDir, std::path::PathBuf) { + let (tmp, root) = fixture("uncovered"); + let policy = fs::read_to_string(config(&root)).unwrap(); + let accepted = ["tools/gen.go", "tools/other.go"] + .into_iter() + .filter(|f| *f != except) + .map(|f| format!("'{f}'")) + .collect::>() + .join(", "); + fs::write( + config(&root), + format!("{policy}uncovered_ok:\n - {{ name: [{accepted}], because: build helpers }}\n"), + ) + .unwrap(); + (tmp, root) +} + +/// An accepted gap is a note in every CI format, one per `uncovered_ok` entry +/// with its reason, never a failed test case, `--require-evidence` or not. +#[test] +fn an_accepted_gap_is_a_note_in_every_ci_format() { + let (_tmp, root) = accepting_tools(""); + for require_evidence in [false, true] { + let checked = check_with(&root, |o| o.require_evidence = require_evidence); + assert_eq!(checked.outcome(), Outcome::Passed); + let report = checked.report(); + + let accepted: Vec<_> = notifications(&report.sarif()) + .into_iter() + .filter(|(kind, _, _)| kind == "accepted-gap") + .collect(); + assert_eq!( + accepted, + [( + "accepted-gap".to_string(), + "note".to_string(), + vec!["tools/gen.go".to_string(), "tools/other.go".to_string()], + )] + ); + + let junit = report.junit(); + assert!(junit.contains("failures=\"0\""), "{junit}"); + assert!( + junit.contains( + "accepted gap (uncovered_ok: tools/gen.go, tools/other.go) because build helpers; files: tools/gen.go, tools/other.go" + ), + "{junit}" + ); + + let github = report.github(); + let notices: Vec<&str> = github + .lines() + .filter(|l| l.contains("title=easement accepted-gap::")) + .collect(); + assert_eq!(notices.len(), 1, "{github}"); + assert!(notices[0].starts_with("::notice "), "{github}"); + assert!(notices[0].contains("because build helpers"), "{github}"); + } +} + +/// A `--diff` run that could not read some code says the two apart: the +/// narrowing is a notice, the evidence gap a warning, or an error when +/// evidence is required. +#[test] +fn a_diff_run_names_the_narrowing_and_the_evidence_gap_apart() { + let (_tmp, root) = fixture("uncovered"); + commit_all(&root); + for (require_evidence, gap) in [(false, "warning"), (true, "error")] { + let checked = check_with(&root, |o| { + o.diff = Some("main".into()); + o.require_evidence = require_evidence; + }); + let report = checked.report(); + let json = parse(&report.json()); + assert!(!json["narrowed"].as_array().unwrap().is_empty(), "{json}"); + assert!( + !json["evidence_gaps"].as_array().unwrap().is_empty(), + "{json}" + ); + + let github = report.github(); + assert!( + github.contains( + "::notice title=easement narrowed::only violations on lines changed since main" + ), + "{github}" + ); + assert!( + github.contains(&format!( + "::{gap} title=easement evidence-gap::2 source files were not covered by an indexer" + )), + "{github}" + ); + + let kinds: Vec<(String, String)> = notifications(&report.sarif()) + .into_iter() + // Whether another test indexed the fixture first does not matter here. + .filter(|(kind, _, _)| kind != "cache") + .map(|(kind, level, _)| (kind, level)) + .collect(); + assert_eq!( + kinds, + [ + ("narrowed".to_string(), "note".to_string()), + ("evidence-gap".to_string(), gap.to_string()), + ] + ); + } +} + +/// No output of any command calls what it leaves out `partial`: it names the +/// narrowing, the evidence gaps and the accepted gaps apart. +#[test] +fn no_output_says_partial() { + // One file accepted, the other an evidence gap, the run narrowed. + let (_tmp, root) = accepting_tools("tools/other.go"); + commit_all(&root); + let config = config(&root); + let mut said = Vec::new(); + for narrow in [ + &(|o: &mut CheckOptions| o.diff = Some("main".into())) as &dyn Fn(&mut CheckOptions), + &|o| o.components = vec!["app".into()], + &|o| o.paths = vec!["app".into()], + ] { + for require_evidence in [false, true] { + let checked = check_with(&root, |o| { + narrow(o); + o.require_evidence = require_evidence; + }); + let report = checked.report(); + let json = parse(&report.json()); + assert!(!json["accepted_gaps"].as_array().unwrap().is_empty()); + assert!(!json["evidence_gaps"].as_array().unwrap().is_empty()); + said.extend([ + report.text(), + report.colored(), + report.json(), + report.sarif(), + report.github(), + report.junit(), + ]); + } + } + let drawn = commands::graph(&config, GraphFormat::Mermaid, None, &mut cache()).unwrap(); + said.extend([drawn.diagram.clone(), drawn.notes()]); + for no_graph in [false, true] { + let proposed = Proposed::One { + source: root.join("app/main.go"), + target: None, + external: Some("fmt".into()), + }; + let answer = commands::propose(&config, &proposed, no_graph, &mut cache()).unwrap(); + said.extend([answer.text(), answer.json()]); + } + let impacted = commands::impact(&config, &[root.join("app")], None, &mut cache()).unwrap(); + said.extend([impacted.text(), impacted.json().unwrap()]); + let why = commands::why(&config, "app", "app", &mut cache()).unwrap(); + said.extend([why.text(), serde_json::to_string(&why).unwrap()]); + said.push(commands::suggest(&config, &mut cache()).unwrap().text()); + let reviewed = commands::review(&config, "main", &mut cache()).unwrap(); + said.extend([reviewed.text(), reviewed.json()]); + said.push( + commands::baseline(&config, false, &mut cache()) + .unwrap() + .text(), + ); + // Last: it writes a policy of its own over the project's. + said.push(commands::init(&root, true, &mut cache()).unwrap()); + for out in &said { + assert!(!out.to_lowercase().contains("partial"), "{out}"); + } +} diff --git a/tests/library/propose.rs b/tests/library/propose.rs index f556b1a..62a2381 100644 --- a/tests/library/propose.rs +++ b/tests/library/propose.rs @@ -107,8 +107,14 @@ fn an_external_proposal_says_when_std_cannot_tell_its_standard_library() { let gap = "`$std` cannot tell the standard library of .ts files"; let ts = said("src/ui/b.ts", "lodash"); assert!(ts.contains(gap), "{ts}"); + // The summary names what the answer leaves out by kind. + assert!( + ts.ends_with("graph not judged (narrowed: --no-graph; 1 evidence gap)\n"), + "{ts}" + ); let go = said("src/ui/b.go", "fmt"); assert!(!go.contains("`$std` cannot tell"), "{go}"); + assert!(go.ends_with("(narrowed: --no-graph)\n"), "{go}"); } /// The proposal of an import of the file `to` from the file `from`, both diff --git a/tests/snapshots/library__plan__check_plan_github.snap b/tests/snapshots/library__plan__check_plan_github.snap index 79e0790..b5839b1 100644 --- a/tests/snapshots/library__plan__check_plan_github.snap +++ b/tests/snapshots/library__plan__check_plan_github.snap @@ -6,5 +6,5 @@ expression: checked.report().github() ::notice file=src/web/a.ts,line=1,title=easement plan::Not in the plan: src/web/a.ts -> src/core/c.ts ::notice file=src/web/a.ts,line=2,title=easement plan::Not in the plan: src/web/a.ts -> external lodash/fp ::notice title=easement plan::Planned, not in the code: src/web/a.ts -> src/core/b.ts, src/web/a.ts -> external zod -::notice title=easement partial::only violations on lines changed since main, or caused by the change to the policy, were judged, the rest of the project was not +::notice title=easement narrowed::only violations on lines changed since main, or caused by the change to the policy, were judged, the rest of the project was not easement passed: 0 violation(s), 0 stale, 0 legalized; 4 files, 1 internal deps diff --git a/tests/snapshots/library__suppressions__check_suppression_added_github.snap b/tests/snapshots/library__suppressions__check_suppression_added_github.snap index ee80e5c..aab15ca 100644 --- a/tests/snapshots/library__suppressions__check_suppression_added_github.snap +++ b/tests/snapshots/library__suppressions__check_suppression_added_github.snap @@ -3,5 +3,5 @@ source: tests/library/suppressions.rs expression: github --- ::notice file=src/web/page.ts,line=1,title=easement suppression::dependency suppressed (the page saves drafts until #40): web -> storage is not allowed (written as src/storage/db.ts) -::notice title=easement partial::only violations on lines changed since main, or caused by the change to the policy, were judged, the rest of the project was not +::notice title=easement narrowed::only violations on lines changed since main, or caused by the change to the policy, were judged, the rest of the project was not easement passed: 0 violation(s), 0 stale, 0 legalized; 3 files, 2 internal deps, 1 suppressed