You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for opening the issue ! Thanks to your analysis we're suddenly figuring out the root cause of some issues that were opened for some time now 😉
Bug Report
Since pylint version 2.14.2, the
init-hook
no longer supports quoted code. This is because with PR #6944, the function call toutils._unquote
inpylint/config/config_initialization.py
was removed: https://github.com/PyCQA/pylint/pull/6944/files#diff-dd2760aa48f0278b8c66e126913d22c0f9749cca892ef3c4104b957f4c899f68L48-R48Example
To reproduce this bug, I created a small example repository with the following contents:
The contents of
file1.py
are:The contents of
file2.py
are:The contents of
.pylintrc
are:The purpose of the
init-hook
is to add thesrc
directory to the python path, so pylint can locate all imports correctly.Current Behaviour
When invoking pylint in the repository root with
src/mypackage/file1.py
, it is unable to importmypackage.file2
:However, pylint is able to import
mypackage.file2
if I eitherinit-hook
code orExpected Behaviour
When running
pylint src/mypackage/file1.py
, pylint should be able to importmypackage.file2
.Environment Information
pylint version 2.14.2
python version 3.10.5
macOS version 12.3.1
The text was updated successfully, but these errors were encountered: