From 3abbabae16df8793423912d7a30ca2f13ac240f3 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Sun, 15 Jul 2018 09:45:41 +0200 Subject: Control the maximum number of inference values from pylint with --limit-inference-results --- pylint/lint.py | 7 +++++++ 1 file changed, 7 insertions(+) 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': '', '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': '', '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(): -- cgit v1.2.1