aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/check_platform_reqs.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/check_platform_reqs.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/check_platform_reqs.rs')
-rw-r--r--crates/mozart/src/commands/check_platform_reqs.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/crates/mozart/src/commands/check_platform_reqs.rs b/crates/mozart/src/commands/check_platform_reqs.rs
index e3d432a..346d479 100644
--- a/crates/mozart/src/commands/check_platform_reqs.rs
+++ b/crates/mozart/src/commands/check_platform_reqs.rs
@@ -18,8 +18,6 @@ pub struct CheckPlatformReqsArgs {
pub format: Option<String>,
}
-// ─── Data structures ─────────────────────────────────────────────────────────
-
/// A single platform requirement collected from a package.
#[derive(Debug, Clone)]
struct PlatformRequirement {
@@ -51,8 +49,6 @@ struct CheckResult {
failed_requirement: Option<(String, String)>,
}
-// ─── Main entry point ────────────────────────────────────────────────────────
-
pub async fn execute(
args: &CheckPlatformReqsArgs,
cli: &super::Cli,
@@ -111,8 +107,6 @@ pub async fn execute(
Ok(())
}
-// ─── Requirement collection ──────────────────────────────────────────────────
-
/// Collect platform requirements from all packages (lock/installed) plus root.
///
/// Returns a map of platform-package-name → list of requirements.
@@ -275,8 +269,6 @@ fn add_platform_requirements_from_map(
}
}
-// ─── Requirement checking ────────────────────────────────────────────────────
-
fn check_requirements(
requirements: &BTreeMap<String, Vec<PlatformRequirement>>,
platform: &[mozart_core::platform::PlatformPackage],
@@ -352,8 +344,6 @@ fn determine_exit_code(results: &[CheckResult]) -> i32 {
code
}
-// ─── Rendering ───────────────────────────────────────────────────────────────
-
fn render_text(results: &[CheckResult], console: &Console) {
if results.is_empty() {
return;
@@ -454,8 +444,6 @@ fn render_json(results: &[CheckResult], console: &Console) -> anyhow::Result<()>
Ok(())
}
-// ─── Tests ───────────────────────────────────────────────────────────────────
-
#[cfg(test)]
mod tests {
use super::*;
@@ -463,8 +451,6 @@ mod tests {
use std::collections::BTreeMap;
use tempfile::tempdir;
- // ── Helpers ──────────────────────────────────────────────────────────────
-
fn test_console() -> mozart_core::console::Console {
mozart_core::console::Console::new(0, true, false, true, true)
}
@@ -534,8 +520,6 @@ mod tests {
std::fs::write(path, serde_json::to_string_pretty(&lock_json).unwrap()).unwrap();
}
- // ── test_is_platform_package ──────────────────────────────────────────────
-
#[test]
fn test_is_platform_package() {
assert!(mozart_core::platform::is_platform_package("php"));
@@ -559,8 +543,6 @@ mod tests {
));
}
- // ── test_collect_requirements_from_lock ──────────────────────────────────
-
#[test]
fn test_collect_requirements_from_lock() {
let dir = tempdir().unwrap();
@@ -608,8 +590,6 @@ mod tests {
assert_eq!(php_reqs[0].provider, "vendor/pkg");
}
- // ── test_collect_requirements_no_dev ─────────────────────────────────────
-
#[test]
fn test_collect_requirements_no_dev() {
let dir = tempdir().unwrap();
@@ -662,8 +642,6 @@ mod tests {
);
}
- // ── test_collect_requirements_includes_root ───────────────────────────────
-
#[test]
fn test_collect_requirements_includes_root() {
let dir = tempdir().unwrap();
@@ -704,8 +682,6 @@ mod tests {
);
}
- // ── test_check_requirements_all_pass ─────────────────────────────────────
-
#[test]
fn test_check_requirements_all_pass() {
let requirements =
@@ -725,8 +701,6 @@ mod tests {
assert_eq!(determine_exit_code(&results), 0);
}
- // ── test_check_requirements_version_mismatch ─────────────────────────────
-
#[test]
fn test_check_requirements_version_mismatch() {
let requirements = make_requirements(&[("php", ">=8.2", "vendor/pkg")]);
@@ -740,8 +714,6 @@ mod tests {
assert_eq!(determine_exit_code(&results), 1);
}
- // ── test_check_requirements_missing ──────────────────────────────────────
-
#[test]
fn test_check_requirements_missing() {
let requirements = make_requirements(&[("ext-foobar", "*", "vendor/pkg")]);
@@ -754,8 +726,6 @@ mod tests {
assert_eq!(determine_exit_code(&results), 2);
}
- // ── test_check_requirements_mixed ────────────────────────────────────────
-
#[test]
fn test_check_requirements_mixed() {
let requirements = make_requirements(&[
@@ -780,8 +750,6 @@ mod tests {
assert_eq!(determine_exit_code(&results), 2);
}
- // ── test_check_requirements_multiple_constraints ──────────────────────────
-
#[test]
fn test_check_requirements_multiple_constraints() {
// Two packages both require php, one with a tighter constraint
@@ -800,8 +768,6 @@ mod tests {
assert_eq!(failed_provider, "vendor/b");
}
- // ── test_output_json_format ───────────────────────────────────────────────
-
#[test]
fn test_output_json_format() {
let results = [
@@ -860,8 +826,6 @@ mod tests {
assert_eq!(json_results[1]["provider"], "vendor/pkg");
}
- // ── test_lib_packages_always_missing ─────────────────────────────────────
-
#[test]
fn test_lib_packages_always_missing() {
// lib-pcre present in platform with satisfying version → Success
@@ -877,8 +841,6 @@ mod tests {
);
}
- // ── test_composer_api_packages_missing ───────────────────────────────────
-
#[test]
fn test_composer_api_packages_missing() {
// composer-plugin-api and composer-runtime-api present in platform → Success
@@ -904,8 +866,6 @@ mod tests {
}
}
- // ── test_lib_package_constraint_not_satisfied ─────────────────────────────
-
#[test]
fn test_lib_package_constraint_not_satisfied() {
// lib-pcre is in platform but constraint does NOT match → Failed
@@ -922,8 +882,6 @@ mod tests {
assert_eq!(results[0].version, "10.42");
}
- // ── test_lib_package_not_in_platform ─────────────────────────────────────
-
#[test]
fn test_lib_package_not_in_platform() {
// lib-pcre is NOT in platform data at all → Missing
@@ -940,8 +898,6 @@ mod tests {
assert_eq!(results[0].version, "n/a");
}
- // ── test_determine_exit_code ──────────────────────────────────────────────
-
#[test]
fn test_determine_exit_code_all_success() {
let results = vec![CheckResult {