Skip to content

Commit b9ede31

Browse files
Fix last commit to pass CI tests
1 parent d70b510 commit b9ede31

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

codespell_lib/_codespell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def parse_options(
507507
"--interactive",
508508
action="store",
509509
type=int,
510-
default=-1,
510+
default=0,
511511
help="set interactive mode when writing changes:\n"
512512
"- 0: no interactivity.\n"
513513
"- 1: ask for confirmation.\n"
@@ -1139,7 +1139,7 @@ def main(*args: str) -> int:
11391139
for ifile, cfg_file in enumerate(used_cfg_files, start=1):
11401140
print(f" {ifile}: {cfg_file}")
11411141

1142-
if options.interactive >= 0:
1142+
if options.interactive:
11431143
options.write_changes = True
11441144

11451145
if options.regex and options.write_changes:

codespell_lib/tests/test_basic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ def test_interactivity(
238238
assert cs.main(fname) == 0, "empty file"
239239
fname.write_text("abandonned\n")
240240
assert cs.main("-i", "-1", fname) == 1, "bad"
241+
fname.write_text("abandonned\n")
241242
with FakeStdin("y\n"):
242243
assert cs.main("-i", "3", fname) == 1
244+
fname.write_text("abandonned\n")
243245
with FakeStdin("n\n"):
244246
result = cs.main("-w", "-i", "3", fname, std=True)
245247
assert isinstance(result, tuple)

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,6 @@ max-complexity = 45
169169
[tool.ruff.lint.pylint]
170170
allow-magic-value-types = ["bytes", "int", "str",]
171171
max-args = 13
172-
max-branches = 51
173-
max-returns = 11
174-
max-statements = 119
172+
max-branches = 55
173+
max-returns = 13
174+
max-statements = 122

0 commit comments

Comments
 (0)