def save_ignores(config_file: Path, ignores: SyncRules):
    ignores.both.extend(BASE_IGNORES)
    ignores.trim()
    if ignores.is_empty():
        if config_file.exists():
            config_file.unlink()
        return
    with config_file.open('w') as f:
        for (key, value) in asdict(ignores).items():
            f.write(f'''{key}:
''')
            for item in value:
                f.write(f'''{item}
''')
def save_ignores(config_file: Path, ignores: SyncRules):
    ignores.both.extend(BASE_IGNORES)
    ignores.trim()
    if ignores.is_empty():
        if config_file.exists():
            config_file.unlink()
        return
    with config_file.open('w') as f:
        for (key, value) in asdict(ignores).items():
            f.write(f'{key}:
')
            for item in value:
                f.write(f'{item}
')