mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-03 22:09:14 -05:00
Remove defaults before checking whether the intelligent rewrite was successful
This commit is contained in:
@@ -98,7 +98,7 @@ def _write_new_config_file(path, output):
|
||||
# If we failed to intelligently rewrite the sha lines, fall back to the
|
||||
# pretty-formatted yaml output
|
||||
to_write = ''.join(lines)
|
||||
if ordered_load(to_write) != output:
|
||||
if remove_defaults(ordered_load(to_write), CONFIG_SCHEMA) != output:
|
||||
to_write = new_contents
|
||||
|
||||
with open(path, 'w') as f:
|
||||
|
||||
Reference in New Issue
Block a user