Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of quoted init-hook #7010

Merged
merged 2 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/whatsnew/2/2.14/full.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ What's New in Pylint 2.14.4?
----------------------------
Release date: TBA

* Fixed regression that didn't allow quoted ``init-hooks`` in option files.

Closes #7006

What's New in Pylint 2.14.3?
----------------------------
Expand Down
2 changes: 1 addition & 1 deletion pylint/config/config_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _config_initialization(

# Run init hook, if present, before loading plugins
if "init-hook" in config_data:
exec(config_data["init-hook"]) # pylint: disable=exec-used
exec(utils._unquote(config_data["init-hook"])) # pylint: disable=exec-used

# Load plugins if specified in the config file
if "load-plugins" in config_data:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I should just print
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Check that we support quoted init-hooks
# See https://github.com/PyCQA/pylint/issues/7006
[MAIN]
init-hook='print("I should just print")'