Skip to content

Commit a86b1d4

Browse files
authored
fix: Keyword naming rules with library import with underscores is now detected properly (#1734)
1 parent 0ca6b81 commit a86b1d4

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

  • src/robocop/linter/rules
  • tests/linter/rules/naming/wrong_case_in_keyword_call

src/robocop/linter/rules/naming.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ def check_keyword_naming(self, keyword_name: str, node: Node, is_keyword_definit
825825
if " " in part:
826826
normalized = ".".join(parts[i:])
827827
break
828+
else:
829+
normalized = parts[-1]
828830
normalized = normalized.replace("'", "") # replace ' apostrophes
829831
if "_" in normalized:
830832
self.report(

tests/linter/rules/naming/wrong_case_in_keyword_call/test.robot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,9 @@ Quoted "${values_and_words}"
119119
I'll Need To Test Partial Quotes
120120
And "${variables}" And "some other ${variables}" "shall work"
121121
And "nested quotation "Should Not Be" considered " And Single "
122+
123+
Library With Underscore
124+
# Bug #1733
125+
fk_CommonXml.Compare
126+
fk_CommonXml.Compare ${argument}
127+
fk_CommonXml.Compare With Words ${argument}

0 commit comments

Comments
 (0)