import textwrap


def create_matcher_config_file(tmp_path, contents):
    """Helper function to create a matcher config file from a string"""
    tmp_matcher_path = tmp_path / "matcher_config.yml"
    with tmp_matcher_path.open("w", encoding="utf-8") as tmp_matcher_file:
        tmp_matcher_file.write(textwrap.dedent(contents))

    return tmp_matcher_path