
from .cmd import run_cmd # type: ignore

async def get_version(
  name, conf, *, cache, keymanager=None
):
  git = conf['git']
  cmd = f"git ls-remote -t --refs {git}"
  data = await cache.get(cmd, run_cmd)
  versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
  return versions


from .cmd import run_cmd # type: ignore

async def get_version(
  name, conf, *, cache, keymanager=None
):
  git = conf['git']
  cmd = f"git ls-remote -t --refs {git}"
  data = await cache.get(cmd, run_cmd)
  versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
  return versions

Use list comprehension instead of map lambda
Use list comprehension instead of map lambda

  
  from .cmd import run_cmd # type: ignore
  
  async def get_version(
    name, conf, *, cache, keymanager=None
  ):
    git = conf['git']
    cmd = f"git ls-remote -t --refs {git}"
    data = await cache.get(cmd, run_cmd)
-   versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
+   versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
    return versions
  
Use list comprehension instead of map lambda
## Code Before:

from .cmd import run_cmd # type: ignore

async def get_version(
  name, conf, *, cache, keymanager=None
):
  git = conf['git']
  cmd = f"git ls-remote -t --refs {git}"
  data = await cache.get(cmd, run_cmd)
  versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
  return versions

## Instruction:
Use list comprehension instead of map lambda
## Code After:

from .cmd import run_cmd # type: ignore

async def get_version(
  name, conf, *, cache, keymanager=None
):
  git = conf['git']
  cmd = f"git ls-remote -t --refs {git}"
  data = await cache.get(cmd, run_cmd)
  versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
  return versions
