Motivation
Calling get_hook_names modifies the YAML file - only with cosmetic changes but it's still annoying. We should be able to have a read-only version of this operation.
More generally, respecting round-trip quote convention would be excellent, if possible under ruamel.yaml. I feel like I had an issue open for this in the past but the conclusion was that it didn't support this. In any case, having a read_only=True flag to the edit_pre_commit_config_yaml context manager might be a simple fix.
Summary of desired enhancement
Test and fix the side effect of get_hook_names.
Motivation
Calling
get_hook_namesmodifies the YAML file - only with cosmetic changes but it's still annoying. We should be able to have a read-only version of this operation.More generally, respecting round-trip quote convention would be excellent, if possible under
ruamel.yaml. I feel like I had an issue open for this in the past but the conclusion was that it didn't support this. In any case, having aread_only=Trueflag to theedit_pre_commit_config_yamlcontext manager might be a simple fix.Summary of desired enhancement
Test and fix the side effect of
get_hook_names.