Skip to content

Commit

Permalink
FIX: ignore whitespaces in TOML comparison (#202)
Browse files Browse the repository at this point in the history
* ENH: sort keys in Taplo config comparison
  • Loading branch information
redeboer authored Oct 9, 2023
1 parent f364cca commit eb80d4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/repoma/check_dev_files/toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def _update_taplo_config() -> None:
del expected["exclude"]
with open(CONFIG_PATH.taplo) as f:
existing = tomlkit.load(f)
expected_str = tomlkit.dumps(expected)
expected_str = tomlkit.dumps(expected, sort_keys=True)
existing_str = tomlkit.dumps(existing)
if existing_str != expected_str:
if existing_str.strip() != expected_str.strip():
with open(CONFIG_PATH.taplo, "w") as stream:
stream.write(expected_str)
msg = f"Updated {CONFIG_PATH.taplo} config file"
Expand Down

0 comments on commit eb80d4d

Please sign in to comment.