Skip to content

Commit

Permalink
format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
granawkins committed Feb 16, 2024
1 parent a7de885 commit 2a0a3b5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/rawdog/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ def read_config_file():
with open(config_path, "r") as f:
_config = yaml.safe_load(f)
missing_fields = {
k: v for k, v in default_config.items()
k: v
for k, v in default_config.items()
if k not in _config or (v is not None and _config[k] is None)
}
if missing_fields:
print(f"Updating config file {config_path} for version {__version__}:")
if "leash" in missing_fields and _config.get("dry_run"):
missing_fields["leash"] = True
del _config["dry_run"]
print(" - dry_run: deprecated on v0.1.4, setting leash=True instead")
print(
" - dry_run: deprecated on v0.1.4, setting leash=True instead"
)
for k, v in missing_fields.items():
print(f" + {k}: {v}")
_config[k] = v
Expand All @@ -66,7 +69,9 @@ def add_config_flags_to_argparser(parser):
parser.add_argument(f"--{normalized}", action="store_true", help=help_text)
else:
parser.add_argument(f"--{normalized}", default=None, help=help_text)
parser.add_argument("--dry-run", action="store_true", help="Deprecated, use --leash instead)")
parser.add_argument(
"--dry-run", action="store_true", help="Deprecated, use --leash instead)"
)


def get_config(args=None):
Expand Down

0 comments on commit 2a0a3b5

Please sign in to comment.