-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] configure non-local-variables-should-be-uppercase
to allow lower-case variables
#678
Comments
I agree. We need better mechanism for parsing the variables though - maybe steal something from the core Robot Framework. It's now always possible to recognize what is a variable, nested variable and what just text (Robot uses dynamic context to decide that) but it should be possible to cover basic cases (especially if we at least cache the local scope), |
We can check if the variable contains another variable in its name and allow it to be lower-case by default for this rule, because we can't really tell what's the value of the inserted variable, so we should not report an issue then. For example, here:
we don't know what's the value of When it comes to the original request - I would allow for parametrizing this rule to allow lower-case characters, because it will not make much sense to allow lower-case characters in the rule named From the other hand, we could create a new rule (like |
Well, we don't need to know value of ${proto} - we only need it know if ${proto} is local variable. Because we only care about what is actually written in the file (and how the dynamic variable name will look like is outside that). In previous example we would want following code do not raise any issues:
Because stuff, proto are local variables and ${EXAMPLE_..} is not recognized so it should be global. It's actually quite challenging topic because normally first argument of any |
I don't know if I was properly understood, so I will try to be more specific. I think that we can just detect if inside any non-local variable name, there is an element like Example:
I think this would be the way we can improve this rule, and it would address the original issue. |
Ah, ok. I agree. There is |
@rikerfi The change will be released as Robocop 3.1.0 soon. |
It should be possible to configure
non-local-variables-should-be-uppercase
to allow lower-case variables in it.The text was updated successfully, but these errors were encountered: