-
Notifications
You must be signed in to change notification settings - Fork 37
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
Ignore nested variables in rules 0309 and 0310 #813
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #813 +/- ##
==========================================
+ Coverage 96.88% 96.90% +0.01%
==========================================
Files 25 25
Lines 3471 3484 +13
==========================================
+ Hits 3363 3376 +13
Misses 108 108
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Create note in https://github.com/MarketSquare/robotframework-robocop/tree/master/docs/releasenotes to not lose the changes. |
The nodes have the error Can you point me to the place in User Guide where it says that such nested variables are not allowed? I couldn't find it... |
I had the same problem when working on The only mention in the user guide is: (under Variable section)
But it's about values, not variable names.. . Edit. I have created test file:
If I run it, I will get:
|
@bhirsz Take a look at my example here: EDIT: If you run your code with |
Hm, isn't it because "variable needs to exist to be used as part of the other variable name in
|
Well, that makes sense! I will adjust the code. I am still curious how RF should handle it. Let's see what Pekka responds. |
@bhirsz The PR is ready, please review when you have time. |
* Update Bug Report template * Small update to deprecation message * Fix 0310 rule to ignore nested variables * Update also W0309 section-variable-not-uppercase rule * Fixes after review, add release notes * Fix conditions * Fixes * Refactor * Fix tests for RF3 * Update release notes, refactor * Extend test code
Rules W0310
non-local-variables-should-be-uppercase
and W0309section-variable-not-uppercase
were previously reporting when the variable had another nested variable with lowercase name,
e.g.
${EXAMPLE_${lowercase}}
.Now, the nested variables are ignored and if the rest of the name is uppercase, the rules
will not report the issue anymore.
Closes #678