summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-09-02 22:19:02 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2015-09-02 22:19:02 +0300
commite0a6f98dca977ee29d34690877da8220467bc030 (patch)
tree5ae1ae6ea0a44738aa913be37445a73b83aab5c7
parent7d9d8365065376461c588162afa6b0c495d8353c (diff)
downloadpylint-e0a6f98dca977ee29d34690877da8220467bc030.tar.gz
Make the --profile flag obsolete. Will be removed in Pylint 1.6.
-rw-r--r--ChangeLog4
-rw-r--r--pylint/lint.py17
-rw-r--r--pylint/test/test_self.py5
3 files changed, 10 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 88ed860..8fcb2ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -261,7 +261,9 @@ ChangeLog for Pylint
as a special case for the reversed builtin. This will happen
shortly in the future.
- * --comment flag was obsoleted and it will be removed in Pylint 1.6.
+ * --comment flag is obsoleted and it will be removed in Pylint 1.6.
+
+ * --profile flag is obsoleted and it will be removed in Pylint 1.6.
diff --git a/pylint/lint.py b/pylint/lint.py
index 0bc3234..16913f4 100644
--- a/pylint/lint.py
+++ b/pylint/lint.py
@@ -1221,10 +1221,7 @@ group are mutually exclusive.'),
'disabled and only messages emitted by the porting '
'checker will be displayed'}),
- ('profile',
- {'type' : 'yn', 'metavar' : '<y_or_n>',
- 'default': False, 'hide': True,
- 'help' : 'Profiled execution.'}),
+ ('profile', utils.deprecated_option(opt_type='yn')),
), option_groups=self.option_groups, pylintrc=self._rcfile)
# register standard checkers
@@ -1309,17 +1306,7 @@ group are mutually exclusive.'),
# insert current working directory to the python path to have a correct
# behaviour
with fix_import_path(args):
- if self.linter.config.profile:
- print('** profiled run', file=sys.stderr)
- import cProfile, pstats
- cProfile.runctx('linter.check(%r)' % args, globals(), locals(),
- 'stones.prof')
- data = pstats.Stats('stones.prof')
- data.strip_dirs()
- data.sort_stats('time', 'calls')
- data.print_stats(30)
- else:
- linter.check(args)
+ linter.check(args)
linter.generate_reports()
if exit:
sys.exit(self.linter.msg_status)
diff --git a/pylint/test/test_self.py b/pylint/test/test_self.py
index 618d232..d1c9238 100644
--- a/pylint/test/test_self.py
+++ b/pylint/test/test_self.py
@@ -169,6 +169,11 @@ class RunTC(unittest.TestCase):
"slated for removal in Pylint 1.6")
self._test_deprecated_options("--include-ids=y", expected)
+ def test_deprecated_options_profile(self):
+ expected = ("option --profile is obsoleted and it is "
+ "slated for removal in Pylint 1.6")
+ self._test_deprecated_options("--profile=y", expected)
+
def test_help_message_option(self):
self._runtest(['--help-msg', 'W0101'], code=0)