robotframework-robocop
robotframework-robocop copied to clipboard
Detect unused arguments
I suggest creating a new rule which would report an argument of a keyword if it is not used at all in the body of keyword (be it declared in [Arguments], or in the keyword name in case of embedded arguments). E. g.:
My Keyword
[Arguments} ${arg} # <-- unused!
Log Hello!
Note: No dynamic analysis...
Note 2: I do not suggest this new rule to check when an argument is used, but a value is assigned to it only without retieving it again --- this situation should be covered by https://github.com/MarketSquare/robotframework-robocop/issues/209 once it will be implemented. :)
That can be done. Thanks! And you are welcome to come up with your solution by creating a PR to this project, if you have some time :)
@mnojek, this is not a matter of time. My knowledge of Python and object-oriented programming do not allow me to contribute to such a big project...
No problem. Contributing by giving ideas is also extremely helpful. Thanks to that, we can further improve the tool :)