def get_linter_and_formatter(cfg, silent=False):
    'Get a linter object given a config.'
    try:
        dialect_selector(cfg.get('dialect'))
    except KeyError:
        click.echo('Error: Unknown dialect {0!r}'.format(cfg.get('dialect')))
        sys.exit(66)
    if (not silent):
        formatter = CallbackFormatter(callback=(lambda m: click.echo(m, color=cfg.get('color'))), verbosity=cfg.get('verbose'), output_line_length=cfg.get('output_line_length'))
        return (Linter(config=cfg, formatter=formatter), formatter)
    else:
        formatter = CallbackFormatter(callback=(lambda m: None), verbosity=0)
        return (Linter(config=cfg), formatter)
Get a linter object given a config.
def get_linter_and_formatter(cfg, silent=False):
    
    try:
        dialect_selector(cfg.get('dialect'))
    except KeyError:
        click.echo('Error: Unknown dialect {0!r}'.format(cfg.get('dialect')))
        sys.exit(66)
    if (not silent):
        formatter = CallbackFormatter(callback=(lambda m: click.echo(m, color=cfg.get('color'))), verbosity=cfg.get('verbose'), output_line_length=cfg.get('output_line_length'))
        return (Linter(config=cfg, formatter=formatter), formatter)
    else:
        formatter = CallbackFormatter(callback=(lambda m: None), verbosity=0)
        return (Linter(config=cfg), formatter)