aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-26 02:26:08 +0900
committernsfisis <nsfisis@gmail.com>2026-06-26 02:26:08 +0900
commit8c4dc6cd48457f154eb067f296d79ef911573c91 (patch)
tree10acc2f4f64813f9b206d474306e5680234ec73d /crates/shirabe/src/command
parent6c89c720d9e4728c288e3c66ffb7dcb4cba5121c (diff)
downloadphp-shirabe-8c4dc6cd48457f154eb067f296d79ef911573c91.tar.gz
php-shirabe-8c4dc6cd48457f154eb067f296d79ef911573c91.tar.zst
php-shirabe-8c4dc6cd48457f154eb067f296d79ef911573c91.zip
fix(check-platform-reqs-command): add PlatformRepository to existing composite
execute nested the already-built InstalledRepository inside a second InstalledRepository, tripping the assertion that an InstalledRepository may not contain another. PHP adds a PlatformRepository to the existing composite via addRepository; do the same. Un-ignores CheckPlatformReqsCommandTest::test_failed_platform_requirement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command')
-rw-r--r--crates/shirabe/src/command/base_command.rs7
-rw-r--r--crates/shirabe/src/command/check_platform_reqs_command.rs11
-rw-r--r--crates/shirabe/src/command/licenses_command.rs25
3 files changed, 17 insertions, 26 deletions
diff --git a/crates/shirabe/src/command/base_command.rs b/crates/shirabe/src/command/base_command.rs
index f754d0a..f3c88e5 100644
--- a/crates/shirabe/src/command/base_command.rs
+++ b/crates/shirabe/src/command/base_command.rs
@@ -583,12 +583,7 @@ impl BaseCommand for BaseCommandData {
.expect("Table::set_style I/O cannot fail")
.expect("'compact' is a built-in table style");
renderer
- .set_rows(
- table
- .into_iter()
- .map(Into::into)
- .collect(),
- )
+ .set_rows(table.into_iter().map(Into::into).collect())
.render();
let _ = TableSeparator::new();
}
diff --git a/crates/shirabe/src/command/check_platform_reqs_command.rs b/crates/shirabe/src/command/check_platform_reqs_command.rs
index 2ab66c5..a7f5d9c 100644
--- a/crates/shirabe/src/command/check_platform_reqs_command.rs
+++ b/crates/shirabe/src/command/check_platform_reqs_command.rs
@@ -285,13 +285,10 @@ impl Command for CheckPlatformReqsCommand {
let mut requires_sorted: Vec<(String, Vec<Link>)> = requires.into_iter().collect();
requires_sorted.sort_by(|a, b| a.0.cmp(&b.0));
- let installed_repo_with_platform = InstalledRepository::new(vec![
- crate::repository::RepositoryInterfaceHandle::new(installed_repo),
- crate::repository::RepositoryInterfaceHandle::new(PlatformRepository::new(
- vec![],
- indexmap::IndexMap::new(),
- )?),
- ]);
+ installed_repo.add_repository(crate::repository::RepositoryInterfaceHandle::new(
+ PlatformRepository::new(vec![], indexmap::IndexMap::new())?,
+ ));
+ let installed_repo_with_platform = installed_repo;
let mut results: Vec<CheckResult> = vec![];
let mut exit_code = 0;
diff --git a/crates/shirabe/src/command/licenses_command.rs b/crates/shirabe/src/command/licenses_command.rs
index e8d62cc..f2672bd 100644
--- a/crates/shirabe/src/command/licenses_command.rs
+++ b/crates/shirabe/src/command/licenses_command.rs
@@ -201,11 +201,7 @@ impl Command for LicensesCommand {
let mut table = Table::new(output);
table.set_style("compact".into())??;
- table.set_headers(vec![
- "Name".into(),
- "Version".into(),
- "Licenses".into(),
- ]);
+ table.set_headers(vec!["Name".into(), "Version".into(), "Licenses".into()]);
for package in &packages {
let link = PackageInfo::get_view_source_or_homepage_url(package.clone());
let name = if let Some(link) = link {
@@ -227,14 +223,17 @@ impl Command for LicensesCommand {
} else {
pkg_licenses.join(", ")
};
- table.add_row(PhpMixed::List(vec![
- PhpMixed::String(name),
- PhpMixed::String(package.get_full_pretty_version(
- true,
- crate::package::DisplayMode::SourceRefIfDev,
- )),
- PhpMixed::String(licenses_str),
- ]).into());
+ table.add_row(
+ PhpMixed::List(vec![
+ PhpMixed::String(name),
+ PhpMixed::String(package.get_full_pretty_version(
+ true,
+ crate::package::DisplayMode::SourceRefIfDev,
+ )),
+ PhpMixed::String(licenses_str),
+ ])
+ .into(),
+ );
}
table.render();
}