diff options
author | Eli Fine <eli88fine@gmail.com> | 2020-09-19 12:39:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 09:39:43 -0700 |
commit | e602fdae52195b5f4b9e6c4945c32164b7a7e36f (patch) | |
tree | 2461a88fca565482a740cd1dd49e1f22d45007a9 /tests/input | |
parent | 4980369e6dcee8929b881dc9ec365523cd8d82b3 (diff) | |
download | pylint-git-e602fdae52195b5f4b9e6c4945c32164b7a7e36f.tar.gz |
fixed issue 3726: enhanced similarity checker (#3837)
* fixed issue 3726 similarity checker false positive for lines without meaningful content
made unit test case more robust by pushing it closer to the minimum number of similarity lines limit
added 'r' in front of regular expression string to please pylint
Co-authored-by: Eli Fine <ubuntu@ip-172-31-89-59.ec2.internal>
Diffstat (limited to 'tests/input')
-rw-r--r-- | tests/input/similar3 | 25 | ||||
-rw-r--r-- | tests/input/similar4 | 25 |
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/input/similar3 b/tests/input/similar3 new file mode 100644 index 000000000..337431fe5 --- /dev/null +++ b/tests/input/similar3 @@ -0,0 +1,25 @@ +a = ( + ( + [ + "Lines 1-8 used to trigger a similarity warning, but now they don't because...", + "...lines with only symbols are ignored and don't count in the line count limit." + ] + ), +) + +"This line in similar3 breaks up the sections of code by being different than similar4" + +b = ( + ( + [ + "Lines 12-25 still trigger a similarity...", + "...warning, because..." + ], + [ + "...even after ignoring lines with only symbols..." + ], + ), + ( + "...there are still 5 similar lines in this code block.", + ) +) diff --git a/tests/input/similar4 b/tests/input/similar4 new file mode 100644 index 000000000..abdad26db --- /dev/null +++ b/tests/input/similar4 @@ -0,0 +1,25 @@ +a = ( + ( + [ + "Lines 1-8 used to trigger a similarity warning, but now they don't because...", + "...lines with only symbols are ignored and don't count in the line count limit." + ] + ), +) + +"This line in similar4 breaks up the sections of code by being different than similar3" + +b = ( + ( + [ + "Lines 12-25 still trigger a similarity...", + "...warning, because..." + ], + [ + "...even after ignoring lines with only symbols..." + ], + ), + ( + "...there are still 5 similar lines in this code block.", + ) +) |