mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-40549 Remove ignore_interpreter
This commit is contained in:
parent
3b94354b60
commit
c6560dd65c
@ -50,17 +50,6 @@ class LinterBase(object, metaclass=ABCMeta):
|
||||
"""
|
||||
return False
|
||||
|
||||
def ignore_interpreter(self):
|
||||
# type: () -> bool
|
||||
# pylint: disable=no-self-use
|
||||
"""
|
||||
Check if we should ignore the interpreter when searching for the linter to run.
|
||||
|
||||
This applies to mypy specifically since the pylinters are executed under Python 2 but mypy
|
||||
is executed by python 3.
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
class LinterInstance(object):
|
||||
"""A pair of a Linter and the full path of the linter cmd to run."""
|
||||
|
@ -30,14 +30,3 @@ class MypyLinter(base.LinterBase):
|
||||
if 'idl' in file_name or 'linter' in file_name:
|
||||
return [file_name]
|
||||
return []
|
||||
|
||||
def ignore_interpreter(self):
|
||||
# type: () -> bool
|
||||
# pylint: disable=no-self-use
|
||||
"""
|
||||
Check if we should ignore the interpreter when searching for the linter to run.
|
||||
|
||||
This applies to mypy specifically since the pylinters are executed under Python 2 but mypy
|
||||
is executed by python 3.
|
||||
"""
|
||||
return True
|
||||
|
@ -86,17 +86,7 @@ def _find_linter(linter, config_dict):
|
||||
# On Linux, these scripts are installed in %PYTHONDIR%\bin like
|
||||
# '/opt/mongodbtoolchain/v3/bin', but they may point to the wrong interpreter.
|
||||
cmd_str = os.path.join(python_dir, linter.cmd_name)
|
||||
|
||||
if linter.ignore_interpreter():
|
||||
# Some linters use a different interpreter then the current interpreter.
|
||||
# If the linter cmd_location is specified then use that location.
|
||||
if linter.cmd_location:
|
||||
cmd_str = linter.cmd_location
|
||||
else:
|
||||
cmd_str = os.path.join('/opt/mongodbtoolchain/v3/bin', linter.cmd_name)
|
||||
cmd = [cmd_str]
|
||||
else:
|
||||
cmd = [sys.executable, cmd_str]
|
||||
cmd = [sys.executable, cmd_str]
|
||||
|
||||
# Check 1: interpreter location or for linters that ignore current interpreter.
|
||||
if _check_version(linter, cmd, linter.get_lint_version_cmd_args()):
|
||||
|
Loading…
Reference in New Issue
Block a user