From a56f16b7a7e5b7b40a9d613e8cbec671a052f9e3 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Mon, 30 Nov 2015 00:46:56 +0200 Subject: Add wrong-import-position to check_messages's decorator arguments for ImportChecker.leave_module This fixes an esoteric bug which occurs when ungrouped-imports and wrong-import-order are disabled and pylint is executed on multiple files. What happens is that without wrong-import-position in check_messages, leave_module will never be called, which means that the first non-import node from other files might leak into the current file, leading to wrong-import-position being emitted by pylint. --- pylint/test/regrtest_data/wrong_import_position.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 pylint/test/regrtest_data/wrong_import_position.py (limited to 'pylint/test/regrtest_data/wrong_import_position.py') diff --git a/pylint/test/regrtest_data/wrong_import_position.py b/pylint/test/regrtest_data/wrong_import_position.py new file mode 100644 index 0000000..9e2d099 --- /dev/null +++ b/pylint/test/regrtest_data/wrong_import_position.py @@ -0,0 +1,11 @@ +"""Test that wrong-import-position is properly reset when +other errors are disabled. +""" +# pylint: disable=unused-import, too-few-public-methods + + +class Something(object): + """A class before an import.""" + + +import os -- cgit v1.2.1