On 02 mai 18:25, Hans Sebastian wrote:
> I tried the custom checker in my previous reply again but it's still not
> working. I loaded it in my config file using
> 'load-plugins=my_import_checker'. And then, I commented out the register
> method in imports.py. Fyi, when I comment out this register method without
> my custom checker, the import errors disappear so I know at least that
> works.
> 
> My current workaround is by adding the custom checker extending
> ImportsChecker directly in imports.py and editing the register method to use
> my custom checker instead. That works. But it would be nice if it can exists
> in its own file so it's like an actual plugin, besides being easier to
> maintain. :)

[snip]

I fail to grasp what's going on. Trying to reproduce your problem, here is what 
I have done:

[syt@scorpius ~]$ cat ~/src/pylint_import.py
from pylint.checkers.imports import ImportsChecker

class MyImportsChecker(ImportsChecker):
    pass

def register(linter):
    """required method to auto register this checker """
    linter.register_checker(MyImportsChecker(linter))

[syt@scorpius pylint]$ hg diff
diff --git a/checkers/imports.py b/checkers/imports.py
--- a/checkers/imports.py
+++ b/checkers/imports.py
@@ -364,8 +364,8 @@ given file (report RP0402 must not be di
             self.__int_dep_info = filter_dependencies_info(
                 self.stats['dependencies'], self.package_dir(), 'internal')
         return self.__int_dep_info
 
 
-def register(linter):
-    """required method to auto register this checker """
-    linter.register_checker(ImportsChecker(linter))
+# def register(linter):
+#     """required method to auto register this checker """
+#     linter.register_checker(ImportsChecker(linter))


[syt@scorpius pylint]$ pylint --load-plugins=pylint_import pylint
No config file found, using default configuration
************* Module config
[run smoothly]

Any difference between that and what you're doing?

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to