-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new message called duplicate-value for sets (#5928)
Adds some new functionality which checks for duplicate values inside sets. For that reason, we create a new message called duplicate-value. Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
- Loading branch information
1 parent
79f3e1d
commit 06bc0a6
Showing
8 changed files
with
61 additions
and
5 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
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 @@ | ||
incorrect_set = {'value1', 23, 5, 'value1'} # [duplicate-value] |
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 @@ | ||
correct_set = {'value1', 23, 5} |
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
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,18 @@ | ||
# pylint: disable = invalid-name, line-too-long | ||
"""Simple test sets for checking duplicate values""" | ||
|
||
set1 = {1, 2, 3, 4} | ||
set2 = {1, 1, 2} # [duplicate-value] | ||
set3 = {1, 2, 2} # [duplicate-value] | ||
|
||
set4 = {'one', 'two', 'three'} | ||
set5 = {'one', 'two', 'one'} # [duplicate-value] | ||
set6 = {'one', 'two', 'two'} # [duplicate-value] | ||
|
||
wrong_set = {12, 23, True, 6, True, 0, 12} # [duplicate-value, duplicate-value] | ||
correct_set = {12, 13, 23, 24, 89} | ||
|
||
wrong_set_mixed = {1, 2, 'value', 1} # [duplicate-value] | ||
wrong_set = {'arg1', 'arg2', False, 'arg1', True} # [duplicate-value] | ||
|
||
another_wrong_set = {2, 3, 'arg1', True, 'arg1', False, True} # [duplicate-value, duplicate-value] |
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,10 @@ | ||
duplicate-value:5:7:5:16::Duplicate value 1 in set:HIGH | ||
duplicate-value:6:7:6:16::Duplicate value 2 in set:HIGH | ||
duplicate-value:9:7:9:28::Duplicate value 'one' in set:HIGH | ||
duplicate-value:10:7:10:28::Duplicate value 'two' in set:HIGH | ||
duplicate-value:12:12:12:42::Duplicate value 12 in set:HIGH | ||
duplicate-value:12:12:12:42::Duplicate value True in set:HIGH | ||
duplicate-value:15:18:15:36::Duplicate value 1 in set:HIGH | ||
duplicate-value:16:12:16:49::Duplicate value 'arg1' in set:HIGH | ||
duplicate-value:18:20:18:61::Duplicate value 'arg1' in set:HIGH | ||
duplicate-value:18:20:18:61::Duplicate value True in set:HIGH |