Repository: omni-us/jsonargparse
Pull request #639 (2024-12-03 07:09:13)

ArgumentParser check_config method and skip_check parameter renamed to validate and skip_validation
## Before submitting

- [x] Did you read the [contributing guideline](https://github.com/omni-us/jsonargparse/blob/main/CONTRIBUTING.rst)?
- [x] Did you update **the documentation**? (readme and public docstrings)
- [x] Did you write **unit tests** such that there is 100% coverage on related code? (required for bug fixes and new features)
- [x] Did you verify that new and existing **tests pass locally**?
- [x] Did you make sure that all changes preserve **backward compatibility**?
- [x] Did you update **the CHANGELOG**? (not for typos, docs, test updates, or minor internal changes/refactors)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [98.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [98.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639)


sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=639&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [98.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=639&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=639)



Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 95a6793..50a762a 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -23,11 +23,14 @@ Added
 
 Changed
 ^^^^^^^
-
 - ``jsonargparse.CLI`` renamed to ``jsonargparse.auto_cli`` to follow `PEP 8
   <https://peps.python.org/pep-0008/#function-and-variable-names>`__ functions
   naming convention (`#640
   <https://github.com/omni-us/jsonargparse/pull/640>`__).
+- ``ArgumentParser.check_config`` renamed to ``validate`` and ``skip_check``
+  parameter of ``ArgumentParser.{dump, save, get_defaults}`` renamed to
+  ``skip_validation`` (`#639
+  <https://github.com/omni-us/jsonargparse/pull/639>`__).
 
 Fixed
 ^^^^^
@@ -39,6 +42,13 @@ Fixed
 - Nested dataclass with ``init=False`` not working correctly (`#650
   <https://github.com/omni-us/jsonargparse/pull/650>`__).
 
+Deprecated
+^^^^^^^^^^
+- ``ArgumentParser.check_config`` and ``skip_check`` parameter of
+  ``ArgumentParser.{dump, save, get_defaults}`` are deprecated and will be
+  removed in v5.0.0, instead use ``validate`` and ``skip_validation`` (`#639
+  <https://github.com/omni-us/jsonargparse/pull/639>`__).
+
 
 v4.35.0 (2024-12-16)
 --------------------
@@ -71,6 +81,7 @@ Deprecated
   config argument as ``--print_%s`` instead of being always ``--print_config``
   (`#630 <https://github.com/omni-us/jsonargparse/pull/630>`__).
 
+
 v4.34.1 (2024-12-02)
 --------------------
 
diff --git a/jsonargparse/_actions.py b/jsonargparse/_actions.py
index 7ae6572..8c50a42 100644
--- a/jsonargparse/_actions.py
+++ b/jsonargparse/_actions.py
@@ -192,7 +192,7 @@ class ActionConfigFile(Action):
         from ._link_arguments import skip_apply_links
 
         with _ActionSubCommands.not_single_subcommand(), previous_config_context(cfg), skip_apply_links():
-            kwargs = {"env": False, "defaults": False, "_skip_check": True, "_fail_no_subcommand": False}
+            kwargs = {"env": False, "defaults": False, "_skip_validation": True, "_fail_no_subcommand": False}
             try:
                 cfg_path: Optional[Path] = Path(value, mode=get_config_read_mode())
             except TypeError as ex_path:
@@ -254,7 +254,7 @@ class _ActionPrintConfig(Action):
         )
 
     def __call__(self, parser, namespace, value, option_string=None):
-        kwargs = {"subparser": parser, "key": None, "skip_none": False, "skip_check": False}
+        kwargs = {"subparser": parser, "key": None, "skip_none": False, "skip_validation": False}
         valid_flags = {"": None, "comments": "yaml_comments", "skip_default": "skip_default", "skip_null": "skip_none"}
         if value is not None:
             flags = value[0].split(",")
@@ -666,7 +666,7 @@ class _ActionSubCommands(_SubParsersAction):
         if subcommand in self._name_parser_map:
             subparser = self._name_parser_map[subcommand]
             subnamespace = namespace.get(subcommand).clone() if subcommand in namespace else None
-            kwargs = dict(_skip_check=True, **parse_kwargs.get())
+            kwargs = dict(_skip_validation=True, **parse_kwargs.get())
             namespace[subcommand] = subparser.parse_args(arg_strings, namespace=subnamespace, **kwargs)
 
     @staticmethod
@@ -779,9 +779,9 @@ class _ActionSubCommands(_SubParsersAction):
             key = prefix + subcommand
             with parent_parsers_context(key, parser):
                 if env:
-                    subnamespace = subparser.parse_env(defaults=defaults, _skip_check=True)
+                    subnamespace = subparser.parse_env(defaults=defaults, _skip_validation=True)
                 elif defaults:
-                    subnamespace = subparser.get_defaults(skip_check=True)
+                    subnamespace = subparser.get_defaults(skip_validation=True)
 
             # Update all subcommand settings
             if subnamespace is not None:
diff --git a/jsonargparse/_completions.py b/jsonargparse/_completions.py
index eb901ff..21960ed 100644
--- a/jsonargparse/_completions.py
+++ b/jsonargparse/_completions.py
@@ -51,7 +51,7 @@ def get_files_completer():
 def argcomplete_namespace(caller, parser, namespace):
     if caller == "argcomplete":
         namespace.__class__ = __import__("jsonargparse").Namespace
-        namespace = parser.merge_config(parser.get_defaults(skip_check=True), namespace).as_flat()
+        namespace = parser.merge_config(parser.get_defaults(skip_validation=True), namespace).as_flat()
     return namespace
 
 
diff --git a/jsonargparse/_core.py b/jsonargparse/_core.py
index ee503b6..f9f1009 100644
--- a/jsonargparse/_core.py
+++ b/jsonargparse/_core.py
@@ -49,7 +49,7 @@ from ._completions import (
     argcomplete_namespace,
     handle_completions,
 )
-from ._deprecated import ParserDeprecations
+from ._deprecated import ParserDeprecations, deprecated_skip_check
 from ._formatters import DefaultHelpFormatter, empty_help, get_env_var
 from ._jsonnet import ActionJsonnet
 from ._jsonschema import ActionJsonSchema
@@ -315,7 +315,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         env: Optional[bool],
         defaults: bool,
         with_meta: Optional[bool],
-        skip_check: bool,
+        skip_validation: bool,
         skip_required: bool = False,
         skip_subcommands: bool = False,
         fail_no_subcommand: bool = True,
@@ -327,7 +327,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             env: Whether to merge with the parsed environment, None to use parser's default.
             defaults: Whether to merge with the parser's defaults.
             with_meta: Whether to include metadata in config object, None to use parser's default.
-            skip_check: Whether to skip check if configuration is valid.
+            skip_validation: Whether to skip validation of configuration.
             skip_required: Whether to skip check of required arguments.
             skip_subcommands: Whether to skip subcommand processing.
             fail_no_subcommand: Whether to fail if no subcommand given.
@@ -355,8 +355,8 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             except Exception as ex:
                 self.error(str(ex), ex)
 
-            if not skip_check:
-                self.check_config(cfg, skip_required=skip_required)
+            if not skip_validation:
+                self.validate(cfg, skip_required=skip_required)
 
         if not (with_meta or (with_meta is None and self._default_meta)):
             cfg = strip_meta(cfg)
@@ -371,7 +371,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
     ):
         cfg = Namespace()
         if defaults:
-            cfg = self.get_defaults(skip_check=True)
+            cfg = self.get_defaults(skip_validation=True)
 
         if env or (env is None and self._default_env):
             if environ is None:
@@ -409,7 +409,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         Raises:
             ArgumentError: If the parsing fails error and exit_on_error=True.
         """
-        skip_check = get_private_kwargs(kwargs, _skip_check=False)
+        skip_validation = get_private_kwargs(kwargs, _skip_validation=False)
         return_parser_if_captured(self)
         handle_completions(self)
 
@@ -436,7 +436,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 env=env,
                 defaults=defaults,
                 with_meta=with_meta,
-                skip_check=skip_check,
+                skip_validation=skip_validation,
             )
 
         except (TypeError, KeyError) as ex:
@@ -468,7 +468,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         Raises:
             ArgumentError: If the parsing fails error and exit_on_error=True.
         """
-        skip_check, skip_required = get_private_kwargs(kwargs, _skip_check=False, _skip_required=False)
+        skip_validation, skip_required = get_private_kwargs(kwargs, _skip_validation=False, _skip_required=False)
 
         try:
             cfg = self._parse_defaults_and_environ(defaults, env)
@@ -484,7 +484,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 env=env,
                 defaults=defaults,
                 with_meta=with_meta,
-                skip_check=skip_check,
+                skip_validation=skip_validation,
                 skip_required=skip_required,
             )
 
@@ -507,7 +507,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 env_val = env[env_var]
                 if env_val in action.choices:
                     cfg[action.dest] = subcommand = self._check_value_key(action, env_val, action.dest, cfg)
-                    pcfg = action._name_parser_map[env_val].parse_env(env=env, defaults=defaults, _skip_check=True)
+                    pcfg = action._name_parser_map[env_val].parse_env(env=env, defaults=defaults, _skip_validation=True)
                     for k, v in vars(pcfg).items():
                         cfg[subcommand + "." + k] = v
         for action in actions:
@@ -544,7 +544,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         Raises:
             ArgumentError: If the parsing fails error and exit_on_error=True.
         """
-        skip_check, skip_subcommands = get_private_kwargs(kwargs, _skip_check=False, _skip_subcommands=False)
+        skip_validation, skip_subcommands = get_private_kwargs(kwargs, _skip_validation=False, _skip_subcommands=False)
 
         try:
             cfg = self._parse_defaults_and_environ(defaults, env=True, environ=env)
@@ -553,10 +553,10 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 "env": True,
                 "defaults": defaults,
                 "with_meta": with_meta,
-                "skip_check": skip_check,
+                "skip_validation": skip_validation,
                 "skip_subcommands": skip_subcommands,
             }
-            if skip_check:
+            if skip_validation:
                 kwargs["fail_no_subcommand"] = False
 
             parsed_cfg = self._parse_common(cfg=cfg, **kwargs)
@@ -633,7 +633,9 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         Raises:
             ArgumentError: If the parsing fails error and exit_on_error=True.
         """
-        skip_check, fail_no_subcommand = get_private_kwargs(kwargs, _skip_check=False, _fail_no_subcommand=True)
+        skip_validation, fail_no_subcommand = get_private_kwargs(
+            kwargs, _skip_validation=False, _fail_no_subcommand=True
+        )
 
         try:
             with parser_context(load_value_mode=self.parser_mode):
@@ -648,7 +650,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 env=env,
                 defaults=defaults,
                 with_meta=with_meta,
-                skip_check=skip_check,
+                skip_validation=skip_validation,
                 fail_no_subcommand=fail_no_subcommand,
             )
 
@@ -731,9 +733,10 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         format: str = "parser_mode",
         skip_none: bool = True,
         skip_default: bool = False,
-        skip_check: bool = False,
+        skip_validation: bool = False,
         yaml_comments: bool = False,
         skip_link_targets: bool = True,
+        **kwargs,
     ) -> str:
         """Generates a yaml or json string for the given configuration object.
 
@@ -743,7 +746,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 :func:`.set_dumper`.
             skip_none: Whether to exclude entries whose value is None.
             skip_default: Whether to exclude entries whose value is the same as the default.
-            skip_check: Whether to skip parser checking.
+            skip_validation: Whether to skip parser checking.
             yaml_comments: Whether to add help content as comments. ``yaml_comments=True`` implies ``format='yaml'``.
             skip_link_targets: Whether to exclude link targets.
 
@@ -753,6 +756,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         Raises:
             TypeError: If any of the values of cfg is invalid according to the parser.
         """
+        skip_validation = deprecated_skip_check(ArgumentParser.dump, kwargs, skip_validation)
         check_valid_dump_format(format)
 
         cfg = strip_meta(cfg)
@@ -760,18 +764,18 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             ActionLink.strip_link_target_keys(self, cfg)
 
         with parser_context(load_value_mode=self.parser_mode):
-            if not skip_check:
-                self.check_config(cfg)
+            if not skip_validation:
+                self.validate(cfg)
 
-            dump_kwargs = {"skip_check": skip_check, "skip_none": skip_none}
+            dump_kwargs = {"skip_validation": skip_validation, "skip_none": skip_none}
             self._dump_cleanup_actions(cfg, self._actions, dump_kwargs)
 
             cfg_dict = cfg.as_dict()
 
             if skip_default:
-                defaults = self.get_defaults(skip_check=True)
+                defaults = self.get_defaults(skip_validation=True)
                 ActionLink.strip_link_target_keys(self, defaults)
-                self._dump_cleanup_actions(defaults, self._actions, {"skip_check": True, "skip_none": skip_none})
+                self._dump_cleanup_actions(defaults, self._actions, {"skip_validation": True, "skip_none": skip_none})
                 self._dump_delete_default_entries(cfg_dict, defaults.as_dict())
 
         with parser_context(parent_parser=self):
@@ -797,7 +801,11 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                 value = cfg.get(action_dest)
                 if value is not None:
                     with parser_context(parent_parser=self):
-                        value = action.serialize(value, dump_kwargs=dump_kwargs)
+                        if dump_kwargs.get("skip_validation"):
+                            with suppress(ValueError):
+                                value = action.serialize(value, dump_kwargs=dump_kwargs)
+                        else:
+                            value = action.serialize(value, dump_kwargs=dump_kwargs)
                     cfg.update(value, action_dest)
 
     def _dump_delete_default_entries(self, subcfg, subdefaults):
@@ -827,10 +835,11 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         path: Union[str, os.PathLike],
         format: str = "parser_mode",
         skip_none: bool = True,
-        skip_check: bool = False,
+        skip_validation: bool = False,
         overwrite: bool = False,
         multifile: bool = True,
         branch: Optional[str] = None,
+        **kwargs,
     ) -> None:
         """Writes to file(s) the yaml or json for the given configuration object.
 
@@ -840,20 +849,21 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             format: The output format: ``'yaml'``, ``'json'``, ``'json_indented'``, ``'parser_mode'`` or ones added via
                 :func:`.set_dumper`.
             skip_none: Whether to exclude entries whose value is None.
-            skip_check: Whether to skip parser checking.
+            skip_validation: Whether to skip parser checking.
             overwrite: Whether to overwrite existing files.
             multifile: Whether to save multiple config files by using the __path__ metas.
 
         Raises:
             TypeError: If any of the values of cfg is invalid according to the parser.
         """
+        skip_validation = deprecated_skip_check(ArgumentParser.save, kwargs, skip_validation)
         check_valid_dump_format(format)
 
         def check_overwrite(path):
             if not overwrite and os.path.isfile(path.absolute):
                 raise ValueError(f"Refusing to overwrite existing file: {path.absolute}")
 
-        dump_kwargs = {"format": format, "skip_none": skip_none, "skip_check": skip_check}
+        dump_kwargs = {"format": format, "skip_none": skip_none, "skip_validation": skip_validation}
 
         if fsspec_support:
             try:
@@ -880,9 +890,9 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             cfg = cfg.clone()
             ActionLink.strip_link_target_keys(self, cfg)
 
-            if not skip_check:
+            if not skip_validation:
                 with parser_context(load_value_mode=self.parser_mode):
-                    self.check_config(strip_meta(cfg), branch=branch)
+                    self.validate(strip_meta(cfg), branch=branch)
 
             def save_paths(cfg):
                 for key in cfg.get_sorted_keys():
@@ -912,7 +922,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
 
             with change_to_path_dir(path_fc), parser_context(parent_parser=self):
                 save_paths(cfg)
-            dump_kwargs["skip_check"] = True
+            dump_kwargs["skip_validation"] = True
             with open(path_fc.absolute, "w") as f:
                 f.write(self.dump(cfg, **dump_kwargs))  # type: ignore[arg-type]
 
@@ -961,15 +971,16 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             check_suppressed_default()
         return defaults.get(action.dest)
 
-    def get_defaults(self, skip_check: bool = False) -> Namespace:
+    def get_defaults(self, skip_validation: bool = False, **kwargs) -> Namespace:
         """Returns a namespace with all default values.
 
         Args:
-            skip_check: Whether to skip check if configuration is valid.
+            skip_validation: Whether to skip validation of defaults.
 
         Returns:
             An object with all default values as attributes.
         """
+        skip_validation = deprecated_skip_check(ArgumentParser.get_defaults, kwargs, skip_validation)
         cfg = Namespace()
         for action in filter_default_actions(self._actions):
             if (
@@ -993,7 +1004,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
                             env=False,
                             defaults=False,
                             with_meta=None,
-                            skip_check=skip_check,
+                            skip_validation=skip_validation,
                             skip_required=True,
                         )
                 except (TypeError, KeyError, argparse.ArgumentError) as ex:
@@ -1029,7 +1040,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         sys.stderr.write(f"error: {message}\n")
         self.exit(2)
 
-    def check_config(
+    def validate(
         self,
         cfg: Namespace,
         skip_none: bool = True,
@@ -1375,7 +1386,7 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
             if leaf_key == action.dest:
                 return value
             subparser = action._name_parser_map[leaf_key]  # type: ignore[attr-defined]
-            subparser.check_config(value)
+            subparser.validate(value)
         elif isinstance(action, _ActionConfigLoad):
             if isinstance(value, str):
                 value = action.check_type(value, self)
diff --git a/jsonargparse/_deprecated.py b/jsonargparse/_deprecated.py
index c7df1f8..687eb47 100644
--- a/jsonargparse/_deprecated.py
+++ b/jsonargparse/_deprecated.py
@@ -118,10 +118,10 @@ def parse_as_dict_patch():
     def patch_parse_method(method_name):
         unpatched_method_name = "_unpatched_" + method_name
 
-        def patched_parse(self, *args, _skip_check: bool = False, **kwargs) -> Union[Namespace, Dict[str, Any]]:
+        def patched_parse(self, *args, _skip_validation: bool = False, **kwargs) -> Union[Namespace, Dict[str, Any]]:
             parse_method = getattr(self, unpatched_method_name)
-            cfg = parse_method(*args, _skip_check=_skip_check, **kwargs)
-            return cfg.as_dict() if self._parse_as_dict and not _skip_check else cfg
+            cfg = parse_method(*args, _skip_validation=_skip_validation, **kwargs)
+            return cfg.as_dict() if self._parse_as_dict and not _skip_validation else cfg
 
         setattr(ArgumentParser, unpatched_method_name, getattr(ArgumentParser, method_name))
         setattr(ArgumentParser, method_name, patched_parse)
@@ -146,7 +146,7 @@ def parse_as_dict_patch():
     # Patch dump
     def patched_dump(self, cfg: Union[Namespace, Dict[str, Any]], *args, **kwargs) -> str:
         if isinstance(cfg, dict):
-            cfg = self.parse_object(cfg, _skip_check=True)
+            cfg = self.parse_object(cfg, _skip_validation=True)
         return self._unpatched_dump(cfg, *args, **kwargs)
 
     ArgumentParser._unpatched_dump = ArgumentParser.dump
@@ -155,7 +155,7 @@ def parse_as_dict_patch():
     # Patch save
     def patched_save(self, cfg: Union[Namespace, Dict[str, Any]], *args, multifile: bool = True, **kwargs) -> None:
         if multifile and isinstance(cfg, dict):
-            cfg = self.parse_object(cfg, _skip_check=True)
+            cfg = self.parse_object(cfg, _skip_validation=True)
         return self._unpatched_save(cfg, *args, multifile=multifile, **kwargs)
 
     ArgumentParser._unpatched_save = ArgumentParser.save
@@ -531,6 +531,32 @@ class ParserDeprecations:
             kwargs["help"] = kwargs.pop("title")
         return self.add_class_arguments(*args, **kwargs)
 
+    @deprecated(
+        """
+        ArgumentParser.check_config was deprecated in v4.35.0 and will be removed in
+        v5.0.0. Instead use validate.
+    """
+    )
+    def check_config(self, *args, **kwargs):
+        return self.validate(*args, **kwargs)
+
+
+def deprecated_skip_check(component, kwargs: dict, skip_validation: bool) -> bool:
+    skip_check = kwargs.pop("skip_check", None)
+    if kwargs:
+        raise ValueError(f"Unexpected keyword parameters: {set(kwargs.keys())}")
+    if skip_check is not None:
+        skip_validation = skip_check
+        deprecation_warning(
+            component,
+            (
+                "skip_check parameter was deprecated in v4.35.0 and will be removed in "
+                "v5.0.0. Instead use skip_validation."
+            ),
+            stacklevel=3,
+        )
+    return skip_validation
+
 
 ParserError = ArgumentError
 


Test patch:
diff --git a/jsonargparse_tests/test_core.py b/jsonargparse_tests/test_core.py
index e2c5b00..315e25b 100644
--- a/jsonargparse_tests/test_core.py
+++ b/jsonargparse_tests/test_core.py
@@ -499,6 +499,22 @@ def test_dump_skip_default_nested(parser):
     assert dump == expected
 
 
+def test_dump_skip_validation(parser):
+    parser.add_argument("--key", type=int)
+    cfg = Namespace(key="-")
+    with pytest.raises(TypeError):
+        parser.dump(cfg)
+    dump = parser.dump(cfg, skip_validation=True)
+    assert "-" in dump
+
+
+def test_dump_unexpected_kwarg(parser):
+    parser.add_argument("--key", type=int)
+    cfg = Namespace(key="-")
+    with pytest.raises(ValueError, match="Unexpected keyword parameter"):
+        parser.dump(cfg, unexpected=True)
+
+
 @skip_if_no_pyyaml
 def test_dump_order(parser, subtests):
     args = {}
@@ -956,22 +972,22 @@ def test_add_multiple_config_arguments_error(parser, action):
     ctx.match("only allowed to have a single")
 
 
-def test_check_config_skip_none(parser):
+def test_validate_skip_none(parser):
     parser.add_argument("--op1", type=int)
     parser.add_argument("--op2", type=float)
     cfg = parser.parse_args(["--op2=2.2"])
-    parser.check_config(cfg, skip_none=True)
+    parser.validate(cfg, skip_none=True)
     with pytest.raises(TypeError) as ctx:
-        parser.check_config(cfg, skip_none=False)
+        parser.validate(cfg, skip_none=False)
     ctx.match("Expected a <class 'int'>")
 
 
-def test_check_config_branch(example_parser):
+def test_validate_branch(example_parser):
     cfg = example_parser.get_defaults()
-    example_parser.check_config(cfg.nums, branch="nums")
+    example_parser.validate(cfg.nums, branch="nums")
     cfg.nums.val1 = "invalid"
     with pytest.raises(TypeError) as ctx:
-        example_parser.check_config(cfg.nums, branch="nums")
+        example_parser.validate(cfg.nums, branch="nums")
     ctx.match("Expected a <class 'int'>")
 
 
diff --git a/jsonargparse_tests/test_deprecated.py b/jsonargparse_tests/test_deprecated.py
index 4f85060..ddc7348 100644
--- a/jsonargparse_tests/test_deprecated.py
+++ b/jsonargparse_tests/test_deprecated.py
@@ -18,6 +18,7 @@ from jsonargparse import (
     ArgumentError,
     ArgumentParser,
     LoggerProperty,
+    Namespace,
     Path,
     get_config_read_mode,
     set_url_support,
@@ -339,6 +340,31 @@ def test_parse_as_dict(tmp_cwd):
         assert "{}\n" == f.read()
 
 
+def test_deprecated_skip_check_method(parser):
+    parser.add_argument("--key", type=int)
+    cfg = Namespace(key=1)
+    with catch_warnings(record=True) as w:
+        parser.check_config(cfg)
+    assert_deprecation_warn(
+        w,
+        message="ArgumentParser.check_config was deprecated",
+        code="parser.check_config(cfg)",
+    )
+
+
+def test_deprecated_dump_skip_check_parameter(parser):
+    parser.add_argument("--key", type=int)
+    cfg = Namespace(key="-")
+    with catch_warnings(record=True) as w:
+        dump = parser.dump(cfg, skip_check=True)
+    assert "-" in dump
+    assert_deprecation_warn(
+        w,
+        message="skip_check parameter was deprecated",
+        code="parser.dump(cfg, skip_check=True)",
+    )
+
+
 def test_ActionPath(tmp_cwd):
     os.mkdir(os.path.join(tmp_cwd, "example"))
     rel_yaml_file = os.path.join("..", "example", "example.yaml")