Closed farhaan-shamsee closed 2 weeks ago
I think this issue is related to #1779 which was resolved via #1785. Would you mind trying the latest Copier version from the master
branch?
In addition, I think a default value should always pass the validator, otherwise it's useless and the --defaults
switch makes no sense.
Thanks a lot for the response. I will definitely try this out and revert here if it does not work. I will close this till then.
In addition, I think a default value should always pass the validator, otherwise it's useless and the
--defaults
switch makes no sense.
Exactly, that is why I mentioned that I might be logically incorrect.
Describe the problem
Although might be logically incorrect to provide an empty default value and a validator together.
But I have noticed that, the following combination fails during copier update.
If there is a question having empty
default
value andvalidator
, after doing a copier update it gives error that validation has failed for that question. Even if thewhen
condition is not satisfied, then also if gives the error.This only happens in
copier update
. Incopier copy
this does not come up.Template
Below are the 2 questions.
Even if I answer
No
totest_enable
, thetest_var
gives validation errorKindly note that my envops are different.
To Reproduce
Logs
Expected behavior
As the
when
condition is not satisfied, it should not even consider the validation.Screenshots/screencasts/logs
Operating system
Linux
Operating system distribution and version
22.04 (WSL)
Copier version
copier 9.3.1
Python version
Python 3.10.12
Installation method
pip+git
Additional context
I have not tested this thoroughly. But I have noticed this in my case. In case I am doing something wrong, please feel free to point out.