Skip to content

Commit 3d5b4b3

Browse files
WorkerPantsbenjyw
andauthored
Deprecate the implicit_value option registration kwarg. (Cherry-pick of #20757) (#20758)
It was never used in the Pants repo, and was only implemented back in 2015, as part of removing our use of argparse, for feature parity. It is undocumented, and not supported by the newer BoolOption registration mechanism. So the only place this could be used is in old-style option registration in a third-party plugin, which seems pretty unlikely. However, for good practice, we give a short deprecation period, just in case. Co-authored-by: Benjy Weinberger <[email protected]>
1 parent efc08bb commit 3d5b4b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/python/pants/option/parser.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import yaml
1818

1919
from pants.base.build_environment import get_buildroot
20-
from pants.base.deprecated import validate_deprecation_semver, warn_or_error
20+
from pants.base.deprecated import deprecated_conditional, validate_deprecation_semver, warn_or_error
2121
from pants.option.config import DEFAULT_SECTION, Config
2222
from pants.option.custom_types import (
2323
DictValueComponent,
@@ -415,6 +415,13 @@ def error(
415415
error(OptionNameDoubleDash, arg_name=arg)
416416

417417
# Validate kwargs.
418+
deprecated_conditional(
419+
lambda: "implicit_value" in kwargs,
420+
removal_version="2.21.0a0",
421+
entity="The 'implicit_value' option registration keyword",
422+
hint="Command line flags specifying this option must provide its value explicitly, "
423+
"except for boolean flags, where --foo is the same as --foo=true.",
424+
)
418425
if "implicit_value" in kwargs and kwargs["implicit_value"] is None:
419426
error(ImplicitValIsNone)
420427
type_arg = kwargs.get("type", str)

0 commit comments

Comments
 (0)