import yaml


def get_rule_set(args):
    """Read and parse the config file at the location given when the
    linter script is run.

    Parameters
    ----------
    args : argparse.Namespace
        Arguments input when script is called from the console

    Returns
    -------
    dict
        Contains structured data from the parsed configuration file
    """
    with open(args.rules, 'r') as f:
        text = f.read()
    rule_set = yaml.safe_load(text)
    return rule_set