-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add: Add Plugin for variable redefinition in foreach loop #704
Conversation
Conventional Commits Report
🚀 Conventional commits found. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #704 +/- ##
==========================================
+ Coverage 79.15% 79.28% +0.13%
==========================================
Files 84 85 +1
Lines 2811 2829 +18
Branches 595 599 +4
==========================================
+ Hits 2225 2243 +18
Misses 443 443
Partials 143 143 ☔ View full report in Codecov by Sentry. |
02129ce
to
5aa17ac
Compare
5aa17ac
to
567b91c
Compare
0b1bc5e
to
3111bd8
Compare
What
This pr adds a plugin to check if a variable is redefined by using the same variable name for the list and the element being iterated over.
Why
Using the foreach for redefinition is valid code, but is more likely a typo than intended for normal VT development.
The foreach loop will also not throw an error if the list variable does not exist and is initialised as an empty list instead.
Should be reported:
-> Typo in the second "url" variable
-> Probably a typo in the second "url"
-> Probably a typo in the second "url"
References
Closes: Jira VTOPS-178
Checklist