Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored and jdx committed Nov 26, 2024
1 parent a4e7fa9 commit 59866c0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ jobs:
needs: [build-macos, build-windows]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
if: ${{github.ref_name == 'release' && 'true' || 'false'}}
env:
TEST_TRANCHE: ${{matrix.tranche}}
TEST_TRANCHE_COUNT: 4
Expand Down Expand Up @@ -353,5 +354,5 @@ jobs:
retry_wait_seconds: 30
max_attempts: 2
command: mise test-tool --all
# env:
# MISE_USE_VERSIONS_HOST: 0
env:
MISE_USE_VERSIONS_HOST: 0
2 changes: 1 addition & 1 deletion registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ mdbook.backends = ["asdf:cipherstash/asdf-mdbook"]
mdbook-linkcheck.backends = ["asdf:cipherstash/asdf-mdbook-linkcheck"]
melange.backends = ["aqua:chainguard-dev/melange", "asdf:omissis/asdf-melange"]
melange.os = ["linux", "macos"]
melange.test = ["melange version", "v{{version}}"]
# melange.test = ["melange version", "v{{version}}"] sometimes releases without assets
melt.backends = ["asdf:chessmango/asdf-melt"]
memcached.backends = ["asdf:furkanural/asdf-memcached"]
mercury.backends = ["asdf:susurri/asdf-mercury"]
Expand Down
8 changes: 6 additions & 2 deletions src/cli/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ impl Ls {
.map(|(p, tv)| ((p.id().into(), tv.version.clone()), (p, tv)))
.collect::<HashMap<(String, String), (Arc<dyn Backend>, ToolVersion)>>();

versions.extend(active.clone());
for (k, (b, tv)) in active.clone() {
// remove kebab-cased versions from installs that match an active version
versions.retain(|_, (_, itv)| itv.tv_pathname() != tv.tv_pathname());
versions.insert(k, (b, tv));
}

let rvs: Vec<RuntimeRow> = versions
.into_iter()
Expand Down Expand Up @@ -274,7 +278,7 @@ impl From<RuntimeRow<'_>> for JSONToolVersion {
JSONToolVersion {
symlinked_to: p.symlink_path(&tv),
install_path: tv.install_path(),
version: tv.version,
version: tv.version.clone(),
requested_version: source.as_ref().map(|_| tv.request.version()),
source: source.map(|source| source.as_json()),
installed: !matches!(vs, VersionStatus::Missing(_)),
Expand Down
10 changes: 5 additions & 5 deletions src/cli/prune.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use std::collections::BTreeMap;
use std::sync::Arc;

use console::style;
use eyre::Result;
use crate::backend::Backend;
use crate::cli::args::BackendArg;
use crate::config::tracking::Tracker;
use crate::config::{Config, SETTINGS};
use crate::toolset::{ToolVersion, Toolset, ToolsetBuilder};
use crate::ui::multi_progress_report::MultiProgressReport;
use crate::ui::prompt;
use console::style;
use eyre::Result;

use super::trust::Trust;

Expand Down Expand Up @@ -67,8 +67,8 @@ impl Prune {
let mut to_delete = ts
.list_installed_versions()?
.into_iter()
.map(|(p, tv)| (tv.to_string(), (p, tv)))
.collect::<BTreeMap<String, (Arc<dyn Backend>, ToolVersion)>>();
.map(|(p, tv)| ((tv.ba().short.to_string(), tv.tv_pathname()), (p, tv)))
.collect::<BTreeMap<(String, String), (Arc<dyn Backend>, ToolVersion)>>();

if let Some(backends) = &self.plugin {
to_delete.retain(|_, (_, tv)| backends.contains(tv.ba()));
Expand All @@ -78,7 +78,7 @@ impl Prune {
let mut ts = Toolset::from(cf.to_tool_request_set()?);
ts.resolve()?;
for (_, tv) in ts.list_current_versions() {
to_delete.remove(&tv.to_string());
to_delete.remove(&(tv.ba().short.to_string(), tv.tv_pathname()));
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/toolset/tool_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::hash::hash_to_str;
use crate::toolset::{tool_request, ToolRequest, ToolVersionOptions};
use console::style;
use eyre::Result;
use heck::ToKebabCase;
#[cfg(windows)]
use path_absolutize::Absolutize;

Expand Down Expand Up @@ -269,7 +268,7 @@ impl ToolVersion {

impl Display for ToolVersion {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
write!(f, "{}@{}", &self.ba().full(), &self.version.to_kebab_case())
write!(f, "{}@{}", &self.ba().full(), &self.version)
}
}

Expand Down
2 changes: 1 addition & 1 deletion tasks/test/coverage
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ mise x -- bun i
echo "::endgroup::"
mise x -- ./e2e/run_all_tests
echo "::group::mise test-tool"
MISE_USE_VERSIONS_HOST=1 mise test-tool --all
MISE_USE_VERSIONS_HOST=0 mise test-tool --all
echo "::group::Render lcov report"
cargo llvm-cov report --lcov --output-path "coverage-${TEST_TRANCHE:-}.lcov"

0 comments on commit 59866c0

Please sign in to comment.