diff --git a/README.rst b/README.rst index 66028143b..43932b838 100644 --- a/README.rst +++ b/README.rst @@ -653,9 +653,10 @@ Named arguments support the following configuration options: - **type** : str The type that the provided value will be cast to. The set of acceptable options is {"string", "float", "integer", "boolean"}. If not provided then the default behaviour - is to keep values as strings. Setting the type to "bool" makes the resulting argument - a flag that if provided will set the value to the boolean opposite of the default - value – i.e. *true* if no default value is given, or false if :toml:`default = true`. + is to keep values as strings. Setting the type to "boolean" makes the resulting + argument a flag that if provided will set the value to the boolean opposite of the + default value – i.e. *true* if no default value is given, or false if + :toml:`default = true`. Arguments for cmd and shell tasks diff --git a/poethepoet/task/args.py b/poethepoet/task/args.py index e2102316c..607c24e49 100644 --- a/poethepoet/task/args.py +++ b/poethepoet/task/args.py @@ -123,13 +123,14 @@ def validate_def(cls, task_name: str, args_def: ArgsDef) -> Optional[str]: f"Unexpected 'name' option for arg {arg_name!r} of task " f"{task_name!r}" ) - error = cls._validate_type(params, arg_name, task_name) - if error: - return error arg_params.append((params, arg_name, task_name)) positional_multiple = None for params, arg_name, task_name in arg_params: + error = cls._validate_type(params, arg_name, task_name) + if error: + return error + error = cls._validate_params(params, arg_name, task_name) if error: return error