robotframework-tidy
robotframework-tidy copied to clipboard
Enhancement: Transform to add (or remove) container (e.g. library name or resource name) prefix on the front of keyword calls
We feel it is a best practice to always include the library name or resource name on the front of every keyword call. For example, instead of just saying Click Element (from the SeleniumLibrary). We say SeleniumLibrary.Click Element. Or, even better, we create a resource file called Selenium.resource which has a keyword called Click that is a wrapper for the Click Element keyword from the SeleniumLibrary. So, to call that Click keyword, our convention is to always write Selenium.Click. It would be great if a transform could be created for robotidy that would check for this convention and ensure that all keyword calls are prefixed with the library name or resource name that they are being called from. Alternatively, there could be a transform to ensure that library or resource prefixes are NOT included on keyword calls (for people who like the inverse).
I apologise for leaving this issue without the answer for so long - somewhow it escaped me.
It's more difficult to implement because we need to know the source of given keyword - although we could at least load libraries defined in particular *** Settings ***
section and try to match it from there. And it's hard to also find keywords from dynamically loaded libraries (with Import Library keyword for example). But it's definitetly possible - I could try to implement MVP for it and see how it works.