(context: Context, tool: str, run: bool)
Sets run field of tool to RUN. Default to no ignore if tool not in config
Sets run field of tool to RUN. Default to no ignore if tool not in config
Sets run field of tool to RUN . Default to no ignore if tool not in config
def update_tool_run(context: Context, tool: str, run: bool) -> None:
    """Sets run field of tool to RUN. Default to no ignore if tool not in config
    """

    config = context.config
    tool_config = config["tools"]
    all_tools = ", ".join(f"'{k}'" for k in tool_config.keys())
    # Check that TOOL is valid
    if tool not in {t.tool_id() for t in bento.extra.TOOLS}:
        raise InvalidToolException(tool, all_tools)

    if tool not in tool_config:
        # Read default ignore from default config file
        with (
            open(os.path.join(os.path.dirname(__file__), "configs/default.yml"))
        ) as template:
            yml = yaml.safe_load(template)

        default_ignore: List[str] = []
        if tool in yml["tools"]:
            default_ignore = yml["tools"][tool]["ignore"]

        tool_config[tool] = {"ignore": default_ignore}

    tool_config[tool]["run"] = run
    context.config = config
def update_tool_run ( context : Context , tool : str , run : bool ) -> None : config = context . config tool_config = config [ "tools" ] all_tools = ", " . join ( f"'{k}'" for k in tool_config . keys ( ) ) # Check that TOOL is valid if tool not in { t . tool_id ( ) for t in bento . extra . TOOLS } : raise InvalidToolException ( tool , all_tools ) if tool not in tool_config : # Read default ignore from default config file with ( open ( os . path . join ( os . path . dirname ( __file__ ) , "configs/default.yml" ) ) ) as template : yml = yaml . safe_load ( template ) default_ignore : List [ str ] = [ ] if tool in yml [ "tools" ] : default_ignore = yml [ "tools" ] [ tool ] [ "ignore" ] tool_config [ tool ] = { "ignore" : default_ignore } tool_config [ tool ] [ "run" ] = run context . config = config