Skip to content
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

Transformer RenameKeywords Incorrectly convert to lower case name when Library is first #199

Closed
IlfirinPL opened this issue Sep 16, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@IlfirinPL
Copy link

IlfirinPL commented Sep 16, 2021

Related to #194
Transformer RenameKeywords Incorrectly convert to lower case name when Library is first

For case when ex. Library is first like this case Process. will incorrectly convert "Run" to "run"
Process.Run Process -> Process.run Process
RPA.Browser.Playwright.Take Screenshot -> Rpa.browser.playwright.take Screenshot

@bhirsz bhirsz added the bug Something isn't working label Sep 16, 2021
@bhirsz
Copy link
Member

bhirsz commented Sep 16, 2021

Thank you for the report - I was able to reproduce it and also fix locally. I will push fix soon.

@bhirsz bhirsz self-assigned this Sep 16, 2021
@IlfirinPL
Copy link
Author

There is case with "RPA" where whole string should stay uppercase. Maybe in future whitelist for substrings

@IlfirinPL
Copy link
Author

I have similar case for Library name issues
SeleniumLibrary.Open Browser -> Seleniumlibrary.open Browser
SSHLibrary.Open Connection host -> Sshlibrary.open Connection host

@bhirsz
Copy link
Member

bhirsz commented Sep 16, 2021

I think I will just ignore library part - so only keyword part (after last '.') is capitalized. For example:
RPA.keyword -> RPA.Keyword

But

Rpa.Keyword -> Rpa.Keyword (since we don't change library part).

Then it could be improved in the future if we will get module for recognizing libraries from pythonpath.

@bhirsz
Copy link
Member

bhirsz commented Sep 16, 2021

The alternative is that I can try to at least title case every part of the name:

RPA.Browser.playwright.Take Screenshot -> splits into RPA, Browser, playwright, Take Screenshot. playwright -> Playwright and rest stays without change.

@IlfirinPL
Copy link
Author

IlfirinPL commented Sep 16, 2021

I think is nice solution for now, but in future I see other cases in some keywords project will use some abbreviations.
example
Connect To System ABC
Create Product DFG

where ABC and DFG are part that should stay uppercase

This make it a little more complex.
And Libraries names will be included as default

@bhirsz
Copy link
Member

bhirsz commented Sep 16, 2021

I've reworked it a bit to just uppercase first letter of every words, so parts like ABC stays ABC (and not Abc).

@IlfirinPL
Copy link
Author

I have tested this version its great way to format old code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants