summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <thenault@gmail.com>2014-04-30 15:34:12 +0200
committerSylvain Th?nault <thenault@gmail.com>2014-04-30 15:34:12 +0200
commit03b18258c118e2d5f0d64d3fe53b45a1cbdb3787 (patch)
tree697243c254fa6c2e4d0c1a728c66c1ab1001b782
parent909f52765007fbd35c024fe0f9dbef99ab83c3e8 (diff)
parentd69c458b87c52c8af173979e6583ca6b0aa5ed3c (diff)
downloadpylint-03b18258c118e2d5f0d64d3fe53b45a1cbdb3787.tar.gz
Merged in living180/pylint/fix_rcfile_init_hook (pull request #109)
Fix running init-hook provided by configuration file.
-rw-r--r--ChangeLog3
-rw-r--r--lint.py8
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 371b0ba..a073050 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@ ChangeLog for Pylint
====================
--
+ * Restore the ability to specify the init-hook option via the
+ configuration file, which was accidentally broken in 1.2.0.
+
* Add a new warning [bad-continuation] for badly indentend continued
lines.
diff --git a/lint.py b/lint.py
index 679ee69..57accd4 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)