Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Sep 30, 2024
1 parent d0a1314 commit d059d18
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion libmamba/src/api/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ namespace mamba
return a.name < b.name;
}

void list_packages(const Context& ctx, std::string regex, ChannelContext& channel_context, list_options options)
void list_packages(
const Context& ctx,
std::string regex,
ChannelContext& channel_context,
list_options options
)
{
auto sprefix_data = PrefixData::create(ctx.prefix_params.target_prefix, channel_context);
if (!sprefix_data)
Expand Down
2 changes: 1 addition & 1 deletion micromamba/src/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ init_list_parser(CLI::App* subcom, Configuration& config)
.group("cli")
.description("Only search for full names, i.e., ^<regex>$."));
subcom->add_flag("-f,--full-name", full_name.get_cli_config<bool>(), full_name.description());

// TODO: implement this in libmamba/list.cpp
/*auto& canonical = config.insert(Configurable("canonical", false)
.group("cli")
Expand Down
4 changes: 3 additions & 1 deletion micromamba/tests/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ def test_list(tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_sele
assert "xtensor" in names
assert "xtl" in names


@pytest.mark.parametrize("quiet_flag", ["", "-q", "--quiet"])
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_list_name(tmp_home, tmp_root_prefix, tmp_xtensor_env, quiet_flag):
helpers.umamba_install("xtensor-python")
helpers.install("xtensor-python")
res = helpers.umamba_list("xt", "--json", quiet_flag)
names = sorted([i["name"] for i in res])
assert names == ["xtensor", "xtensor-python", "xtl"]
Expand All @@ -34,6 +35,7 @@ def test_list_name(tmp_home, tmp_root_prefix, tmp_xtensor_env, quiet_flag):
full_names = sorted([i["name"] for i in full_res])
assert full_names == ["xtensor"]


@pytest.mark.parametrize("env_selector", ["name", "prefix"])
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
def test_not_existing(tmp_home, tmp_root_prefix, tmp_xtensor_env, env_selector):
Expand Down

0 comments on commit d059d18

Please sign in to comment.