From f8eda92379bca390936b233c19e134a828c46eef Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 22 Mar 2025 14:01:39 -0700 Subject: [PATCH] Code formatting (#303). --- borgmatic/borg/check.py | 4 +--- borgmatic/borg/delete.py | 4 +++- borgmatic/borg/transfer.py | 4 +++- borgmatic/config/generate.py | 9 ++++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/borgmatic/borg/check.py b/borgmatic/borg/check.py index 98c48946..13f4ffca 100644 --- a/borgmatic/borg/check.py +++ b/borgmatic/borg/check.py @@ -180,9 +180,7 @@ def check_archives( full_command, # The Borg repair option triggers an interactive prompt, which won't work when output is # captured. And progress messes with the terminal directly. - output_file=( - DO_NOT_CAPTURE if check_arguments.repair or progress else None - ), + output_file=(DO_NOT_CAPTURE if check_arguments.repair or progress else None), environment=environment.make_environment(config), working_directory=working_directory, borg_local_path=local_path, diff --git a/borgmatic/borg/delete.py b/borgmatic/borg/delete.py index d5b02335..a9c3478c 100644 --- a/borgmatic/borg/delete.py +++ b/borgmatic/borg/delete.py @@ -34,7 +34,9 @@ def make_delete_command( + borgmatic.borg.flags.make_flags('umask', config.get('umask')) + borgmatic.borg.flags.make_flags('log-json', global_arguments.log_json) + borgmatic.borg.flags.make_flags('lock-wait', config.get('lock_wait')) - + borgmatic.borg.flags.make_flags('list', delete_arguments.list_archives or config.get('list')) + + borgmatic.borg.flags.make_flags( + 'list', delete_arguments.list_archives or config.get('list') + ) + ( (('--force',) + (('--force',) if delete_arguments.force >= 2 else ())) if delete_arguments.force diff --git a/borgmatic/borg/transfer.py b/borgmatic/borg/transfer.py index 32dc48b3..ca90063e 100644 --- a/borgmatic/borg/transfer.py +++ b/borgmatic/borg/transfer.py @@ -56,7 +56,9 @@ def transfer_archives( return execute_command( full_command, output_log_level=logging.ANSWER, - output_file=DO_NOT_CAPTURE if (transfer_arguments.progress or config.get('progress')) else None, + output_file=( + DO_NOT_CAPTURE if (transfer_arguments.progress or config.get('progress')) else None + ), environment=environment.make_environment(config), working_directory=borgmatic.config.paths.get_working_directory(config), borg_local_path=local_path, diff --git a/borgmatic/config/generate.py b/borgmatic/config/generate.py index bf3b3486..53f20133 100644 --- a/borgmatic/config/generate.py +++ b/borgmatic/config/generate.py @@ -38,8 +38,9 @@ def schema_to_sample_configuration(schema, source_config=None, level=0, parent_i if schema_type == 'array' or (isinstance(schema_type, list) and 'array' in schema_type): config = ruamel.yaml.comments.CommentedSeq( - example if schema['items'].get('type') in SCALAR_SCHEMA_TYPES else - [ + example + if schema['items'].get('type') in SCALAR_SCHEMA_TYPES + else [ schema_to_sample_configuration( schema['items'], source_config, level, parent_is_sequence=True ) @@ -65,7 +66,9 @@ def schema_to_sample_configuration(schema, source_config=None, level=0, parent_i add_comments_to_configuration_object( config, schema, source_config, indent=indent, skip_first=parent_is_sequence ) - elif isinstance(schema_type, list) and all(element_schema_type in SCALAR_SCHEMA_TYPES for element_schema_type in schema_type): + elif isinstance(schema_type, list) and all( + element_schema_type in SCALAR_SCHEMA_TYPES for element_schema_type in schema_type + ): return example elif schema_type in SCALAR_SCHEMA_TYPES: return example