mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
lint: Run mypy as part of main linter.
To support this, we add a pass_targets option to the main linter library, because with current mypy, it's generally counterproductive to pass the list of files in (can produce spurious errors; isn't faster).
This commit is contained in:
@@ -57,8 +57,8 @@ class LinterConfig:
|
||||
self.lint_functions[func.__name__] = func
|
||||
return func
|
||||
|
||||
def external_linter(self, name, command, target_langs=[]):
|
||||
# type: (str, List[str], List[str]) -> None
|
||||
def external_linter(self, name, command, target_langs=[], pass_targets=True):
|
||||
# type: (str, List[str], List[str], bool) -> None
|
||||
"""Registers an external linter program to be run as part of the
|
||||
linter. This program will be passed the subset of files being
|
||||
linted that have extensions in target_langs. If there are no
|
||||
@@ -80,7 +80,11 @@ class LinterConfig:
|
||||
# invoking the external linter.
|
||||
return 0
|
||||
|
||||
p = subprocess.Popen(command + targets,
|
||||
if pass_targets:
|
||||
full_command = command + targets
|
||||
else:
|
||||
full_command = command
|
||||
p = subprocess.Popen(full_command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user