-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow disabling duplicate-code
with a disable comment
#5446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2639a5a
Allow disabling ``duplicate-code`` with a disable comment
DanielNoord d7044ff
Merge branch 'main' into duplicate-code
Pierre-Sassoulas 5ad9a9b
Merge branch 'main' into duplicate-code
DanielNoord c599e2f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_all/third.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_file/first.py
This file contains hidden or 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 @@ | ||
# pylint: disable=duplicate-code | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_file/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_file/third.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/first.py
This file contains hidden or 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 @@ | ||
# pylint: disable=duplicate-code | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/second.py
This file contains hidden or 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 @@ | ||
# pylint: disable=duplicate-code | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_file_double/third.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 # pylint: disable=duplicate-code | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_begin/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 # pylint: disable=duplicate-code | ||
yyyy = 2 # pylint: disable=duplicate-code | ||
zzzz = 3 # pylint: disable=duplicate-code | ||
wwww = 4 # pylint: disable=duplicate-code | ||
vvvv = xxxx + yyyy + zzzz + wwww # pylint: disable=duplicate-code | ||
return vvvv # pylint: disable=duplicate-code |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_disable_all/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv # pylint: disable=duplicate-code |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_end/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 # pylint: disable=duplicate-code | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_line_middle/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_scope/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
# pylint: disable=duplicate-code | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_scope/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_scope/third.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/first.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
# pylint: disable=duplicate-code | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
12 changes: 12 additions & 0 deletions
12
tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/second.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
# pylint: disable=duplicate-code | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
11 changes: 11 additions & 0 deletions
11
tests/regrtest_data/duplicate_code/raw_strings_disable_scope_double/third.py
This file contains hidden or 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 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
Empty file.
21 changes: 21 additions & 0 deletions
21
tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/first.py
This file contains hidden or 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,21 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
# pylint: disable=duplicate-code | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv | ||
|
||
|
||
def look_busy_two(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
20 changes: 20 additions & 0 deletions
20
tests/regrtest_data/duplicate_code/raw_strings_disable_scope_second_function/second.py
This file contains hidden or 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,20 @@ | ||
r"""A raw docstring. | ||
""" | ||
|
||
|
||
def look_busy(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv | ||
|
||
|
||
def look_busy_two(): | ||
xxxx = 1 | ||
yyyy = 2 | ||
zzzz = 3 | ||
wwww = 4 | ||
vvvv = xxxx + yyyy + zzzz + wwww | ||
return vvvv |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty clever.