From b67fe4504af7aed52c9ff708e68a93635ac0b70e Mon Sep 17 00:00:00 2001 From: MercuryDemo <81722899+MercuryDemo@users.noreply.github.com> Date: Tue, 30 Jan 2024 23:35:03 +0800 Subject: [PATCH] Enforce --write-changes in interactive mode --- codespell_lib/_codespell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index 0ff66c822fe..c7cc63bcfe3 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -1126,6 +1126,9 @@ def main(*args: str) -> int: for ifile, cfg_file in enumerate(used_cfg_files, start=1): print(f" {ifile}: {cfg_file}") + if options.interactive > 0: + options.write_changes = True + if options.regex and options.write_changes: return _usage_error( parser,