blob: eff2c9c0f8f4d5d4cd473f2d8073ffe6cfc7ce79 [file] [log] [blame]
#!/usr/bin/env vpython3
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Note: We use tags here instead of refs because refs will always hit the
# network to see if there are any updates.
# [VPYTHON:BEGIN]
# python_version: "3.8"
#
# # Third party dependencies. These are only listed because pylint itself needs
# # them. Feel free to add/remove anything here.
#
# wheel: <
# name: "infra/python/wheels/dill-py3"
# version: "version:0.3.4"
# >
# wheel: <
# name: "infra/python/wheels/futures-py3"
# version: "version:3.1.1"
# >
# wheel: <
# name: "infra/python/wheels/isort-py3"
# version: "version:5.10.1"
# >
# wheel: <
# name: "infra/python/wheels/mccabe-py3"
# version: "version:0.6.1"
# >
# wheel: <
# name: "infra/python/wheels/platformdirs-py3"
# version: "version:2.5.2"
# >
# wheel: <
# name: "infra/python/wheels/six-py3"
# version: "version:1.15.0"
# >
# wheel: <
# name: "infra/python/wheels/toml-py3"
# version: "version:0.10.1"
# >
# wheel: <
# name: "infra/python/wheels/tomli-py3"
# version: "version:2.0.1"
# >
# wheel: <
# name: "infra/python/wheels/wrapt/${vpython_platform}"
# version: "version:1.12.1"
# >
# wheel: <
# name: "infra/python/wheels/lazy-object-proxy/${vpython_platform}"
# version: "version:1.4.3"
# >
# wheel: <
# name: "infra/python/wheels/typing-extensions-py3"
# version: "version:4.0.1"
# >
#
# # Pylint extensions.
#
# wheel: <
# name: "infra/python/wheels/pylint-quotes-py3"
# version: "version:0.2.3"
# >
#
# # Pylint dependencies.
# # NB: Keep in sync with scripts/run_tests.vpython3.
#
# wheel: <
# name: "infra/python/wheels/astroid-py3"
# version: "version:2.11.3"
# >
# wheel: <
# name: "infra/python/wheels/pylint-py3"
# version: "version:2.13.8"
# >
# wheel: <
# name: "infra/python/wheels/packaging-py2_py3"
# version: "version:16.8"
# >
# wheel: <
# name: "infra/python/wheels/pyparsing-py2_py3"
# version: "version:2.2.0"
# >
#
# [VPYTHON:END]
"""Wrapper for stable version of pylint that we control."""
from pathlib import Path
import sys
from pylint import lint
THIS_FILE = Path(__file__).resolve()
# Ensure pylint can find chromite.cli.cros.lint, assuming this script is running
# from chromite/scripts/.
sys.path.append(str(THIS_FILE.parents[2]))
try:
lint.Run(sys.argv[1:])
except Exception:
print(f"{sys.argv[0]} failed; args: {sys.argv}", file=sys.stderr)
raise