Skip to content

Commit d0c099f

Browse files
committed
fix: duplicated rule id for new rule
1 parent 6d990a9 commit d0c099f

File tree

12 files changed

+85
-85
lines changed

12 files changed

+85
-85
lines changed

src/robocop/linter/rules/deprecated.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class DeprecatedRunKeywordIfRule(Rule):
383383
"""
384384

385385
name = "deprecated-run-keyword-if"
386-
rule_id = "DEPR07"
386+
rule_id = "DEPR08"
387387
message = "'{statement_name}' is deprecated, use 'IF' instead"
388388
severity = RuleSeverity.WARNING
389389
version = ">=4.0"
@@ -398,10 +398,10 @@ def check(self, node, keyword_name: str, normalized_keyword_name: str) -> bool:
398398
if normalized_keyword_name in self.run_keyword_if_names:
399399
col = utils.token_col(node, Token.NAME, Token.KEYWORD)
400400
self.report(
401-
statement_name=keyword_name,
402401
node=node,
403402
col=col,
404403
end_col=col + len(keyword_name),
404+
statement_name=keyword_name,
405405
)
406406
return False
407407
return True
@@ -450,7 +450,7 @@ class DeprecatedLoopKeywordRule(Rule):
450450
"""
451451

452452
name = "deprecated-loop-keyword"
453-
rule_id = "DEPR08"
453+
rule_id = "DEPR09"
454454
message = "'{statement_name}' is deprecated, use '{alternative}' instead"
455455
severity = RuleSeverity.WARNING
456456
version = ">=5.0"
@@ -490,7 +490,7 @@ class DeprecatedReturnKeyword(FixableRule):
490490
"""
491491

492492
name = "deprecated-return-keyword"
493-
rule_id = "DEPR09"
493+
rule_id = "DEPR10"
494494
message = "'{statement_name}' is deprecated, use '{alternative}' instead"
495495
severity = RuleSeverity.WARNING
496496
version = ">=5.0"
@@ -570,7 +570,7 @@ class DeprecatedReturnSetting(FixableRule):
570570
"""
571571

572572
name = "deprecated-return-setting"
573-
rule_id = "DEPR10"
573+
rule_id = "DEPR11"
574574
message = "'[Return]' is deprecated, use 'RETURN' instead"
575575
severity = RuleSeverity.WARNING
576576
version = ">=5.0"

tests/linter/rules/deprecated/deprecated_loop_keyword/expected_extended.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
test.robot:5:13 DEPR08 'Continue For Loop' is deprecated, use 'CONTINUE' instead
1+
test.robot:5:13 DEPR09 'Continue For Loop' is deprecated, use 'CONTINUE' instead
22
|
33
3 | FOR ${var} IN RANGE 10
44
4 | WHILE $var
55
5 | Continue For Loop
6-
| ^^^^^^^^^^^^^^^^^ DEPR08
6+
| ^^^^^^^^^^^^^^^^^ DEPR09
77
6 | Continue For Loop If $var > 10
88
7 | Exit For Loop If $var < 0
99
|
1010

11-
test.robot:6:13 DEPR08 'Continue For Loop If' is deprecated, use 'IF and CONTINUE' instead
11+
test.robot:6:13 DEPR09 'Continue For Loop If' is deprecated, use 'IF and CONTINUE' instead
1212
|
1313
4 | WHILE $var
1414
5 | Continue For Loop
1515
6 | Continue For Loop If $var > 10
16-
| ^^^^^^^^^^^^^^^^^^^^ DEPR08
16+
| ^^^^^^^^^^^^^^^^^^^^ DEPR09
1717
7 | Exit For Loop If $var < 0
1818
8 | BuiltIn.Exit For Loop
1919
|
2020

21-
test.robot:7:13 DEPR08 'Exit For Loop If' is deprecated, use 'IF and BREAK' instead
21+
test.robot:7:13 DEPR09 'Exit For Loop If' is deprecated, use 'IF and BREAK' instead
2222
|
2323
5 | Continue For Loop
2424
6 | Continue For Loop If $var > 10
2525
7 | Exit For Loop If $var < 0
26-
| ^^^^^^^^^^^^^^^^ DEPR08
26+
| ^^^^^^^^^^^^^^^^ DEPR09
2727
8 | BuiltIn.Exit For Loop
2828
9 | END
2929
|
3030

31-
test.robot:8:13 DEPR08 'BuiltIn.Exit For Loop' is deprecated, use 'BREAK' instead
31+
test.robot:8:13 DEPR09 'BuiltIn.Exit For Loop' is deprecated, use 'BREAK' instead
3232
|
3333
6 | Continue For Loop If $var > 10
3434
7 | Exit For Loop If $var < 0
3535
8 | BuiltIn.Exit For Loop
36-
| ^^^^^^^^^^^^^^^^^^^^^ DEPR08
36+
| ^^^^^^^^^^^^^^^^^^^^^ DEPR09
3737
9 | END
3838
10 | END
3939
|
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
test.robot:5:13 [W] DEPR08 'Continue For Loop' is deprecated, use 'CONTINUE' instead
2-
test.robot:6:13 [W] DEPR08 'Continue For Loop If' is deprecated, use 'IF and CONTINUE' instead
3-
test.robot:7:13 [W] DEPR08 'Exit For Loop If' is deprecated, use 'IF and BREAK' instead
4-
test.robot:8:13 [W] DEPR08 'BuiltIn.Exit For Loop' is deprecated, use 'BREAK' instead
1+
test.robot:5:13 [W] DEPR09 'Continue For Loop' is deprecated, use 'CONTINUE' instead
2+
test.robot:6:13 [W] DEPR09 'Continue For Loop If' is deprecated, use 'IF and CONTINUE' instead
3+
test.robot:7:13 [W] DEPR09 'Exit For Loop If' is deprecated, use 'IF and BREAK' instead
4+
test.robot:8:13 [W] DEPR09 'BuiltIn.Exit For Loop' is deprecated, use 'BREAK' instead
55

66
Found 4 issues.

tests/linter/rules/deprecated/deprecated_return_keyword/expected_extended.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
test.robot:3:5 DEPR09 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
1+
test.robot:3:5 DEPR10 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
22
|
33
1 | *** Keywords ***
44
2 | RETURN
55
3 | Return From Keyword If $GLOBAL > 10
6-
| ^^^^^^^^^^^^^^^^^^^^^^ DEPR09
6+
| ^^^^^^^^^^^^^^^^^^^^^^ DEPR10
77
4 | BuiltIn.Return From Keyword
88
5 | RETURN
99
|
1010

11-
test.robot:4:5 DEPR09 'BuiltIn.Return From Keyword' is deprecated, use 'RETURN' instead
11+
test.robot:4:5 DEPR10 'BuiltIn.Return From Keyword' is deprecated, use 'RETURN' instead
1212
|
1313
2 | RETURN
1414
3 | Return From Keyword If $GLOBAL > 10
1515
4 | BuiltIn.Return From Keyword
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR09
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR10
1717
5 | RETURN
1818
|
1919

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
actual_fixed${/}test_fix.robot:41:5 DEPR09 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
1+
actual_fixed${/}test_fix.robot:41:5 DEPR10 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
22
|
33
39 |
44
40 | Missing condition
55
41 | Return From Keyword If
6-
| ^^^^^^^^^^^^^^^^^^^^^^ DEPR09
6+
| ^^^^^^^^^^^^^^^^^^^^^^ DEPR10
77
|
88

99
Fixed 9 issues:
1010
- actual_fixed${/}test_fix.robot:
11-
9 x DEPR09 (deprecated-return-keyword)
11+
9 x DEPR10 (deprecated-return-keyword)
1212

1313
Found 10 issues (9 fixed, 1 remaining).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
test.robot:3:5 [W] DEPR09 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
2-
test.robot:4:5 [W] DEPR09 'BuiltIn.Return From Keyword' is deprecated, use 'RETURN' instead
1+
test.robot:3:5 [W] DEPR10 'Return From Keyword If' is deprecated, use 'IF and RETURN' instead
2+
test.robot:4:5 [W] DEPR10 'BuiltIn.Return From Keyword' is deprecated, use 'RETURN' instead
33

44
Found 2 issues.
55
2 fixable with the ``--fix`` option.

tests/linter/rules/deprecated/deprecated_return_setting/expected_extended.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
test.robot:6:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
1+
test.robot:6:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
22
|
33
4 | BuiltIn.Return From Keyword
44
5 | RETURN
55
6 | [Return]
6-
| ^^^^^^^^ DEPR10
6+
| ^^^^^^^^ DEPR11
77
|
88

9-
test_fix.robot:3:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
9+
test_fix.robot:3:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
1010
|
1111
1 | *** Keywords ***
1212
2 | Keyword with [Return]
1313
3 | [Return] 1 # it can be first
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR10
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR11
1515
|
1616

17-
test_fix.robot:9:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
17+
test_fix.robot:9:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
1818
|
1919
7 | Keyword with Multiple [Return] And Empty Lines
2020
8 | [Documentation] First one will be changed to RETURN, second ignored (handled by different rule).
2121
9 | [Return] 1
22-
| ^^^^^^^^^^^^^ DEPR10
22+
| ^^^^^^^^^^^^^ DEPR11
2323
10 | Step 1
2424
11 | [Return] 2
2525
|
2626

27-
test_fix.robot:27:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
27+
test_fix.robot:27:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
2828
|
2929
25 | Keyword With Multiline Return Setting
3030
26 | Keyword
3131
27 | [Return] 1
32-
| ^^^^^^^^ DEPR10
32+
| ^^^^^^^^ DEPR11
3333
28 | ... 2
3434
|
3535

36-
test_fix.robot:31:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
36+
test_fix.robot:31:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
3737
|
3838
29 |
3939
30 | Keyword With Mixed RETURN
4040
31 | [Return] 1 # sets default return
41-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR10
41+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEPR11
4242
32 | IF ${condition}
4343
33 | RETURN 2 # conditional return
4444
|
4545

46-
test_fix.robot:43:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
46+
test_fix.robot:43:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
4747
|
4848
41 | Two Keywords Without New Lines
4949
42 | Keyword
5050
43 | [Return] ${value}
51-
| ^^^^^^^^^^^^^^^^^^^^ DEPR10
51+
| ^^^^^^^^^^^^^^^^^^^^ DEPR11
5252
44 | Two Keywords Without New Lines
5353
45 | Keyword
5454
|
5555

56-
test_fix.robot:46:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
56+
test_fix.robot:46:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
5757
|
5858
44 | Two Keywords Without New Lines
5959
45 | Keyword
6060
46 | [Return] ${value}
61-
| ^^^^^^^^^^^^^^^^^^^^ DEPR10
61+
| ^^^^^^^^^^^^^^^^^^^^ DEPR11
6262
|
6363

64-
test_fix.robot:60:5 DEPR10 '[Return]' is deprecated, use 'RETURN' instead
64+
test_fix.robot:60:5 DEPR11 '[Return]' is deprecated, use 'RETURN' instead
6565
|
6666
58 | [Timeout] 2s
6767
59 | No Operation
6868
60 | [Return] R0
69-
| ^^^^^^^^^^^^^^ DEPR10
69+
| ^^^^^^^^^^^^^^ DEPR11
7070
61 | [Return] R1
7171
62 | [Return] R2
7272
|
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Fixed 7 issues:
22
- actual_fixed${/}test_fix.robot:
3-
7 x DEPR10 (deprecated-return-setting)
3+
7 x DEPR11 (deprecated-return-setting)
44

55
Found 7 issues (7 fixed, 0 remaining).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test.robot:6:5 [W] DEPR10 '[Return]' is deprecated, use 'RETURN' instead
1+
test.robot:6:5 [W] DEPR11 '[Return]' is deprecated, use 'RETURN' instead
22

33
Found 1 issue.
44
1 fixable with the ``--fix`` option.

0 commit comments

Comments
 (0)