зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1730626 - [lint] Print proper error message when clippy is not installed, r=linter-reviewers,marco
Differential Revision: https://phabricator.services.mozilla.com/D125544
This commit is contained in:
Родитель
2578e9a379
Коммит
3c893cc4cb
|
@ -17,16 +17,18 @@ from mozprocess import ProcessHandler
|
|||
|
||||
|
||||
CLIPPY_WRONG_VERSION = """
|
||||
You are probably using an old version of clippy.
|
||||
Expected version is {version}.
|
||||
Clippy is not installed or an older version was detected. Please make sure
|
||||
clippy is installed and up to date. The minimum required version is {version}.
|
||||
|
||||
To install:
|
||||
|
||||
To install it:
|
||||
$ rustup component add clippy
|
||||
|
||||
Or to update it:
|
||||
To update:
|
||||
|
||||
$ rustup update
|
||||
|
||||
And make sure that 'cargo' is in the PATH
|
||||
Also ensure 'cargo' is on your $PATH.
|
||||
""".strip()
|
||||
|
||||
|
||||
|
@ -174,12 +176,12 @@ def lint(paths, config, fix=None, **lintargs):
|
|||
min_version = StrictVersion(min_version_str)
|
||||
actual_version = get_clippy_version(log, cargo)
|
||||
log.debug(
|
||||
"Found version: {}. Minimal expected version: {}".format(
|
||||
"Found version: {}. Minimum expected version: {}".format(
|
||||
actual_version, min_version
|
||||
)
|
||||
)
|
||||
|
||||
if actual_version < min_version:
|
||||
if not actual_version or actual_version < min_version:
|
||||
print(CLIPPY_WRONG_VERSION.format(version=min_version_str))
|
||||
return 1
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче