Skip to content

Commit

Permalink
Fix handling of quoted init-hook (#7010)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Walls <[email protected]>
  • Loading branch information
2 people authored and Pierre-Sassoulas committed Jun 29, 2022
1 parent c159024 commit b379ef3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/whatsnew/2/2.14/full.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Release date: TBA

Closes #6950

* 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")'

0 comments on commit b379ef3

Please sign in to comment.