-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not used variables not detected in IF (#1104)
- Loading branch information
Showing
7 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
unused-variable not detected within IF block (#1093) | ||
---------------------------------------------------- | ||
|
||
If the variable was defined in the IF block, I0920 ``unused-variable`` was not reported even if variable was not used | ||
anywhere:: | ||
|
||
*** Test Cases *** | ||
Useless variable definition | ||
IF True | ||
${not_used} Keyword Call | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/atest/rules/misc/unused_variable/expected_output_rf3.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
test.robot:15:5:15:11 [I] 0920 Variable '${var}' is assigned but not used | ||
test.robot:19:15:19:22 [I] 0920 Variable '${var2}' is assigned but not used | ||
test.robot:23:5:23:11 [I] 0920 Variable '${var}' is assigned but not used | ||
test.robot:31:5:31:14 [I] 0920 Variable '${assign}' is assigned but not used | ||
test.robot:39:9:39:20 [I] 0920 Variable '${not_used}' is assigned but not used | ||
test.robot:44:9:44:32 [I] 0920 Variable '${not_used_from_branch}' is assigned but not used | ||
test.robot:56:13:56:30 [I] 0920 Variable '${nested_define3}' is assigned but not used | ||
test.robot:66:12:66:18 [I] 0920 Variable '${var}' is assigned but not used | ||
test.robot:92:12:92:23 [I] 0920 Variable '${category}' is assigned but not used | ||
test.robot:140:5:140:11 [I] 0920 Variable '${var}' is assigned but not used | ||
test.robot:143:5:143:14 [I] 0920 Variable '${assign}' is assigned but not used | ||
unused_section_vars.robot:21:1:21:19 [I] 0920 Variable '${GLOBAL_NOT_USED}' is assigned but not used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters