aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/dependency.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart/src/commands/dependency.rs')
-rw-r--r--crates/mozart/src/commands/dependency.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/crates/mozart/src/commands/dependency.rs b/crates/mozart/src/commands/dependency.rs
index 4e24f1d..3b6f8c4 100644
--- a/crates/mozart/src/commands/dependency.rs
+++ b/crates/mozart/src/commands/dependency.rs
@@ -11,10 +11,6 @@ use std::path::Path;
use anyhow::Result;
use mozart_core::console_format;
-// ─────────────────────────────────────────────────────────────────────────────
-// Shared command entry point
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Inputs for [`do_execute`], collected from the `depends` / `prohibits` CLI args.
pub struct DoExecuteArgs<'a> {
pub package: &'a str,
@@ -159,10 +155,6 @@ pub fn do_execute(
))
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Core types
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Normalised view of a package's dependency information.
#[derive(Debug, Clone)]
pub struct PackageInfo {
@@ -195,10 +187,6 @@ pub struct DependencyResult {
pub children: Vec<DependencyResult>,
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Package loading
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Load all packages relevant to the dependency query.
///
/// When `locked` is true (or the lock file exists), reads from `composer.lock`.
@@ -348,10 +336,6 @@ fn load_from_installed(working_dir: &Path) -> Result<Vec<PackageInfo>> {
Ok(packages)
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Core algorithm
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Find all packages that have a dependency relationship with the needle(s).
///
/// * `packages` — the full set of packages to search through.
@@ -376,8 +360,6 @@ pub fn get_dependents(
}
}
-// ── Forward (depends) ─────────────────────────────────────────────────────────
-
fn get_dependents_forward(
packages: &[PackageInfo],
needles: &[String],
@@ -485,8 +467,6 @@ fn recurse_dependents(
results
}
-// ── Inverted (prohibits) ──────────────────────────────────────────────────────
-
fn get_prohibitors(
packages: &[PackageInfo],
needles: &[String],
@@ -662,10 +642,6 @@ fn sample_versions_from_constraint(
.collect()
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Output helpers
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Print results as a flat table.
///
/// Columns: package name | version | link description | link constraint
@@ -774,10 +750,6 @@ fn tree_prefix(depth: usize, is_last: bool) -> String {
format!("{indent}{branch}")
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Tests
-// ─────────────────────────────────────────────────────────────────────────────
-
#[cfg(test)]
mod tests {
use super::*;
@@ -805,8 +777,6 @@ mod tests {
}
}
- // ── depends tests ─────────────────────────────────────────────────────────
-
#[test]
fn test_forward_dependency() {
// root requires A, A requires B → depends B returns A (and root not A)
@@ -872,8 +842,6 @@ mod tests {
assert!(!results.is_empty());
}
- // ── prohibits tests ───────────────────────────────────────────────────────
-
#[test]
fn test_prohibits_basic() {
// root requires A ^1.0; user asks "who prohibits A 2.0"
@@ -939,8 +907,6 @@ mod tests {
);
}
- // ── print helpers (smoke tests) ───────────────────────────────────────────
-
#[test]
fn test_print_table_empty() {
let console = mozart_core::console::Console::new(0, false, false, false, false);