You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many times I have encountered a problem with wrongly spelled named arguments being interpreted as position arguments. Especially when the casing/spelling of arguments change (are changed by colleagues). Here is an example:
*** Test Cases ***TC
KW
KW named1=1
KW named_1=1
KW Named2=1
*** Keywords ***KW[Arguments]${named1}=1${named2}=2
Log To Console ${\n}Got named1: "${named1}"
Log To Console Got named2: "${named2}"
And the output below. Problematic are the last and second to last case.
I propose the following solution: Log/print a warning if
a positional argument contains a "=", and
the part that is left of the "=" symbol is similar to the name of a named argument.
Similarity could be determined, for example, using simplified/modified levenshtein distance.
I think this is the location where such a check could be implemented, although I'm not sure whether warnings can be logged by this class (using import warnings?):
This is a real problem, but hard to solve without breaking backwards compatibility massively. The main problem is that = is a pretty commonly used in normal arguments. If we'd always interpret xxx=yyy to mean named argument usage with xxx as the name, that would be massively backwards incompatible and even reporting a warning would be very annoying. If we were to do something like that, it would need to be controlled with a command line option.
I believe we need to return to this at some point.
Hi,
Many times I have encountered a problem with wrongly spelled named arguments being interpreted as position arguments. Especially when the casing/spelling of arguments change (are changed by colleagues). Here is an example:
And the output below. Problematic are the last and second to last case.
I propose the following solution: Log/print a warning if
Similarity could be determined, for example, using simplified/modified levenshtein distance.
I think this is the location where such a check could be implemented, although I'm not sure whether warnings can be logged by this class (using
import warnings
?):robotframework/src/robot/running/arguments/argumentvalidator.py
Line 21 in d32baea
The text was updated successfully, but these errors were encountered: