Skip to content

Commit 7622b2a

Browse files
committed
[REF] duplicate-code: Check disabled from first line to top code line
1 parent 321ae13 commit 7622b2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pylint/checkers/similar.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ def process_module(self, node):
287287
288288
stream must implement the readlines method
289289
"""
290+
if not self.linter.is_message_enabled('R0801') or not node.body:
291+
return
292+
293+
for top_line in range(1, node.body[0].lineno):
294+
if not self.linter.is_message_enabled('R0801', top_line):
295+
return
290296
with node.stream() as stream:
291297
self.append_stream(self.linter.current_name,
292298
stream,

0 commit comments

Comments
 (0)