Pdeuxa
Pdeuxa

Reputation: 699

(bad-plugin-value) Pylint

I try to create a custom Pylint Module, but I can't load it with Pylint.

 pylint test/test.py  --load-plugins pylint_checkers

My plugin module ("pylint_checkers") is located at the root of my repo. I am running pylint inside a pipenv. I got the following error:

E0013: Plugin 'pylint_checkers' is impossible to load, is it installed ? ('No module named 'pylint_checkers'') (bad-plugin-value)

In my module, I have filled the init file with the following register method:

from pylint_checkers.select_cast_checker import SelectCastChecker


__all__ = ["register"]

def register(linter) -> None:
    """required method to auto register this checker"""
    linter.register_checker(SelectCastChecker(linter))

Upvotes: 2

Views: 981

Answers (1)

Pdeuxa
Pdeuxa

Reputation: 699

In case someone will have the same issue. I solved this by adding an init-hook:

--init-hook=''import sys; sys.path.append(".")''

Upvotes: 1

Related Questions