Skip to content

Commit 1b90622

Browse files
committed
Deprecate and remove --strict-boolean from --strict
1 parent 3ed7394 commit 1b90622

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mypy/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ def add_invertible_flag(flag: str,
272272
parser.add_argument('--find-occurrences', metavar='CLASS.MEMBER',
273273
dest='special-opts:find_occurrences',
274274
help="print out all usages of a class member (experimental)")
275-
add_invertible_flag('--strict-boolean', default=False, strict_flag=True,
276-
help='enable strict boolean checks in conditions')
277275
strict_help = "Strict mode. Enables the following flags: {}".format(
278276
", ".join(strict_flag_names))
279277
parser.add_argument('--strict', action='store_true', dest='special-opts:strict',
@@ -292,6 +290,8 @@ def add_invertible_flag(flag: str,
292290
# --dump-graph will dump the contents of the graph of SCCs and exit.
293291
parser.add_argument('--dump-graph', action='store_true', help=argparse.SUPPRESS)
294292
# deprecated options
293+
add_invertible_flag('--strict-boolean', default=False,
294+
help=argparse.SUPPRESS)
295295
parser.add_argument('-f', '--dirty-stubs', action='store_true',
296296
dest='special-opts:dirty_stubs',
297297
help=argparse.SUPPRESS)
@@ -364,6 +364,9 @@ def add_invertible_flag(flag: str,
364364
)
365365

366366
# Process deprecated options
367+
if options.strict_boolean:
368+
print("Warning: --strict-boolean is deprecated; "
369+
"see https://github.com/python/mypy/issues/3195", file=sys.stderr)
367370
if special_opts.almost_silent:
368371
print("Warning: --almost-silent has been replaced by "
369372
"--follow-imports=errors", file=sys.stderr)

0 commit comments

Comments
 (0)