summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCezar <devnull@localhost>2015-09-19 22:42:19 +0300
committerCezar <devnull@localhost>2015-09-19 22:42:19 +0300
commitc3d27a83565e81aef5e358e2588bf6cd22b05650 (patch)
tree8c262df37bc0783b5f99621b16d225687a18f566
parent15df2dbc1286b28fa5ea3c69a7e8651598484a4c (diff)
parentb1cb956b40605c1fbdb85a90a9fe002a46e5cf0c (diff)
downloadpylint-c3d27a83565e81aef5e358e2588bf6cd22b05650.tar.gz
Merge branch
-rw-r--r--ChangeLog8
-rw-r--r--pylint/config.py6
-rw-r--r--pylint/test/test_self.py6
3 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a4de3c5..f209bda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -287,6 +287,14 @@ ChangeLog for Pylint
Closes issue #639.
+ * Abbreviations of command line options are not supported anymore.
+
+ Using abbreviations for CLI options was never considered to be
+ a feature of pylint, this fact being only a side effect of using optparse.
+ As this was the case, using --load-plugin or other abbreviation
+ for --load-plugins never actually worked, while it also didn't raise
+ an error. Closes issue #424.
+
2015-03-14 -- 1.4.3
diff --git a/pylint/config.py b/pylint/config.py
index c9ab351..fb5c2da 100644
--- a/pylint/config.py
+++ b/pylint/config.py
@@ -316,6 +316,12 @@ class OptionParser(optparse.OptionParser):
# Drop the last "\n", or the header if no options or option groups:
return "".join(result[:-1])
+ def _match_long_opt(self, opt):
+ """Disable abbreviations."""
+ if opt not in self._long_opt:
+ raise optparse.BadOptionError(opt)
+ return opt
+
# pylint: disable=abstract-method; by design?
class _ManHelpFormatter(optparse.HelpFormatter):
diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py
index d1c9238..4fbfa39 100644
--- a/pylint/test/test_self.py
+++ b/pylint/test/test_self.py
@@ -101,7 +101,7 @@ class RunTC(unittest.TestCase):
out = six.StringIO()
self._run_pylint(args, out=out)
actual_output = out.getvalue()
- self.assertEqual(expected_output.strip(), actual_output.strip())
+ self.assertIn(expected_output.strip(), actual_output.strip())
def test_pkginfo(self):
"""Make pylint check itself."""
@@ -243,6 +243,10 @@ class RunTC(unittest.TestCase):
self._test_output([module, "--py3k", "-E", "--msg-template='{msg}'"],
expected_output=expected)
+ def test_abbreviations_are_not_supported(self):
+ expected = "no such option: --load-plugin"
+ self._test_output([".", "--load-plugin"], expected_output=expected)
+
if __name__ == '__main__':
unittest.main()