summaryrefslogtreecommitdiff
path: root/lint.py
diff options
context:
space:
mode:
authorDaniel Harding <dharding@living180.net>2014-04-29 11:05:28 -0500
committerDaniel Harding <dharding@living180.net>2014-04-29 11:05:28 -0500
commit9281fd72cbf810f07f3a01651c13c38ed1fb17a7 (patch)
treeca79cb001ff58488efa2f63774eee00b9e0d051a /lint.py
parent3562450869bba928ce70f4183fa32ed5c4477842 (diff)
downloadpylint-git-9281fd72cbf810f07f3a01651c13c38ed1fb17a7.tar.gz
Fix running init-hook provided by configuration file.
--HG-- branch : fix_rcfile_init_hook
Diffstat (limited to 'lint.py')
-rw-r--r--lint.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lint.py b/lint.py
index 679ee6938..57accd436 100644
--- a/lint.py
+++ b/lint.py
@@ -39,7 +39,7 @@ from logilab.common.configuration import UnsupportedAction, OptionsManagerMixIn
from logilab.common.optik_ext import check_csv
from logilab.common.modutils import load_module_from_name, get_module_part
from logilab.common.interface import implements
-from logilab.common.textutils import splitstrip
+from logilab.common.textutils import splitstrip, unquote
from logilab.common.ureports import Table, Text, Section
from logilab.common.__pkginfo__ import version as common_version
@@ -1009,8 +1009,12 @@ are done by default'''}),
linter.disable('suppressed-message')
linter.disable('useless-suppression')
linter.read_config_file()
- # is there some additional plugins in the file configuration, in
config_parser = linter.cfgfile_parser
+ # run init hook, if present, before loading plugins
+ if config_parser.has_option('MASTER', 'init-hook'):
+ cb_init_hook('init-hook',
+ unquote(config_parser.get('MASTER', 'init-hook')))
+ # is there some additional plugins in the file configuration, in
if config_parser.has_option('MASTER', 'load-plugins'):
plugins = splitstrip(config_parser.get('MASTER', 'load-plugins'))
linter.load_plugin_modules(plugins)