summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-07-15 09:45:41 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-07-15 09:45:41 +0200
commit3abbabae16df8793423912d7a30ca2f13ac240f3 (patch)
treeab700b8f9dc583bd9bb15075135cc005d3cc421a
parent49e7a2ad9cf3636968a4612ad08bdc4126fcba73 (diff)
downloadpylint-git-3abbabae16df8793423912d7a30ca2f13ac240f3.tar.gz
Control the maximum number of inference values from pylint with --limit-inference-results
-rw-r--r--pylint/lint.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pylint/lint.py b/pylint/lint.py
index fc517eb25..9d0a106fb 100644
--- a/pylint/lint.py
+++ b/pylint/lint.py
@@ -408,6 +408,12 @@ class PyLinter(config.OptionsManagerMixIn,
' are imported into the active Python interpreter and'
' may run arbitrary code.')}),
+ ('limit-inference-results',
+ {'type': 'int', 'metavar': '<number-of-results>', 'default': 100,
+ 'help': ('Control the amount of potential inferred values when inferring '
+ 'a single object. This can help the performance when dealing with '
+ 'large functions or complex, nested conditions. ')}),
+
('extension-pkg-whitelist',
{'type': 'csv', 'metavar': '<pkg[,pkg]>', 'default': [],
'help': ('A comma-separated list of package or module names'
@@ -1009,6 +1015,7 @@ class PyLinter(config.OptionsManagerMixIn,
'by_msg' : {},
}
MANAGER.always_load_extensions = self.config.unsafe_load_any_extension
+ MANAGER.max_inferable_values = self.config.limit_inference_results
MANAGER.extension_package_whitelist.update(
self.config.extension_pkg_whitelist)
for msg_cat in utils.MSG_TYPES.values():