aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/update.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 17:29:12 +0900
commit49b0884701a84731652fc934d428932ff6029bd4 (patch)
tree7477029b8ed686b9b3b06d960cab2b54ba87b579 /crates/mozart/src/commands/update.rs
parent4623874d1c95414dcd5ae194d2561f2d98b40982 (diff)
downloadphp-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.gz
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.tar.zst
php-mozart-49b0884701a84731652fc934d428932ff6029bd4.zip
chore: remove redundant comments
Diffstat (limited to 'crates/mozart/src/commands/update.rs')
-rw-r--r--crates/mozart/src/commands/update.rs62
1 files changed, 0 insertions, 62 deletions
diff --git a/crates/mozart/src/commands/update.rs b/crates/mozart/src/commands/update.rs
index aa19675..79fd7ba 100644
--- a/crates/mozart/src/commands/update.rs
+++ b/crates/mozart/src/commands/update.rs
@@ -134,10 +134,6 @@ pub struct UpdateArgs {
pub bump_after_update: Option<Option<String>>,
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Change tracking types
-// ─────────────────────────────────────────────────────────────────────────────
-
/// The kind of change for a package during update.
#[derive(Debug, PartialEq, Eq)]
pub enum ChangeKind {
@@ -161,10 +157,6 @@ pub struct UpdateChange {
pub kind: ChangeKind,
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Helper: parse minimum-stability string
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Parse a minimum-stability string from composer.json into a `Stability` enum value.
///
/// Recognizes "stable", "RC", "beta", "alpha", "dev" (case-insensitive).
@@ -256,10 +248,6 @@ fn is_platform_package(name: &str) -> bool {
|| lower == "composer-plugin-api"
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Helper: compute changes between old and new lock
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Compare old lock vs new lock to determine installs, updates, removals, and unchanged packages.
///
/// Produces one `UpdateChange` per affected package. Packages that are identical in both
@@ -336,10 +324,6 @@ pub fn compute_update_changes(
changes
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Helper: apply partial update filter
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Resolve a `LockedPackage`'s normalized version, falling back to the
/// canonical 4-segment form derived from the pretty version when the lock
/// omits `version_normalized`.
@@ -440,10 +424,6 @@ pub fn apply_partial_update(
.collect()
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Wildcard expansion helpers
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Match a single package name against a glob pattern.
///
/// Only the `*` wildcard is supported (matches any sequence of non-`/` characters
@@ -566,10 +546,6 @@ pub fn expand_wildcards(
result
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Dependency expansion helpers
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Build a lookup map from package name (lowercase) to its LockedPackage.
fn build_lock_map(lock: &lockfile::LockFile) -> IndexMap<String, &lockfile::LockedPackage> {
let mut map = IndexMap::new();
@@ -823,10 +799,6 @@ pub fn expand_packages(
packages
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Interactive selection helper
-// ─────────────────────────────────────────────────────────────────────────────
-
/// Interactively prompt the user to select which packages to update.
///
/// For each package in `packages`, prints a y/n prompt and collects the
@@ -886,10 +858,6 @@ pub fn interactive_select_packages(
selected
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Minimal-changes helper
-// ─────────────────────────────────────────────────────────────────────────────
-
/// For `--minimal-changes` mode: when no specific packages are named, pin all
/// packages to their current locked version UNLESS the current locked version
/// no longer satisfies the root constraint. This prevents pulling in newer
@@ -977,10 +945,6 @@ fn major_minor(version: &str) -> (u64, u64) {
(major, minor)
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Main execute function
-// ─────────────────────────────────────────────────────────────────────────────
-
/// CLI entry point. Builds production [`RepositorySet`] (Packagist) and
/// [`FilesystemExecutor`] from `cli`, then dispatches to [`run`].
pub async fn execute(
@@ -1876,17 +1840,11 @@ pub async fn run(
Ok(())
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Tests
-// ─────────────────────────────────────────────────────────────────────────────
-
#[cfg(test)]
mod tests {
use super::*;
use std::collections::BTreeMap;
- // ──────────── Helper constructors ────────────
-
fn make_locked_package(name: &str, version: &str) -> lockfile::LockedPackage {
lockfile::LockedPackage {
name: name.to_string(),
@@ -1950,8 +1908,6 @@ mod tests {
}
}
- // ──────────── parse_minimum_stability ────────────
-
#[test]
fn test_parse_minimum_stability_stable() {
assert_eq!(parse_minimum_stability("stable"), Stability::Stable);
@@ -1989,8 +1945,6 @@ mod tests {
assert_eq!(parse_minimum_stability(""), Stability::Stable);
}
- // ──────────── compute_update_changes ────────────
-
#[test]
fn test_compute_update_changes_all_new() {
// No old lock: all packages in new lock should be Install
@@ -2134,8 +2088,6 @@ mod tests {
);
}
- // ──────────── apply_partial_update ────────────
-
#[test]
fn test_apply_partial_update_keeps_non_specified_packages() {
// old lock has psr/log 3.0.0 and monolog 3.7.0
@@ -2216,8 +2168,6 @@ mod tests {
assert_eq!(psr.version, "3.0.0");
}
- // ──────────── glob_matches ────────────
-
#[test]
fn test_glob_matches_exact() {
assert!(glob_matches("monolog/monolog", "monolog/monolog"));
@@ -2257,8 +2207,6 @@ mod tests {
assert!(!glob_matches("monolog", "monolog/monolog"));
}
- // ──────────── expand_wildcards ────────────
-
#[test]
fn test_expand_wildcards_no_wildcard_passthrough() {
let lock = minimal_lock(vec![make_locked_package("psr/log", "3.0.0")]);
@@ -2315,8 +2263,6 @@ mod tests {
assert_eq!(result, vec!["phpunit/phpunit"]);
}
- // ──────────── expand_with_direct_dependencies ────────────
-
#[test]
fn test_expand_with_direct_deps_adds_require() {
// monolog/monolog requires psr/log
@@ -2384,8 +2330,6 @@ mod tests {
assert_eq!(psr_count, 1, "psr/log should appear only once");
}
- // ──────────── expand_with_all_dependencies ────────────
-
#[test]
fn test_expand_all_deps_transitive() {
// a -> b -> c
@@ -2430,8 +2374,6 @@ mod tests {
assert_eq!(result.len(), 2);
}
- // ──────────── expand_packages ────────────
-
#[test]
fn test_expand_packages_wildcard_with_direct_deps() {
// symfony/* expands to symfony/console; symfony/console requires psr/log
@@ -2456,8 +2398,6 @@ mod tests {
assert!(result.contains(&"psr/log".to_string()));
}
- // ──────────── apply_minimal_changes ────────────
-
#[test]
fn test_apply_minimal_changes_pins_all() {
// Resolver found psr/log 3.0.1, but old lock has 3.0.0
@@ -2473,8 +2413,6 @@ mod tests {
);
}
- // ──────────── Integration test (network, #[ignore]) ────────────
-
#[tokio::test]
#[ignore]
async fn test_update_full_e2e() {