diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index a6d763df6..d1bfb99f5 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1221,7 +1221,8 @@ def GetPylint(input_api, files_to_skip = tuple(files_to_skip or input_api.DEFAULT_FILES_TO_SKIP) extra_paths_list = extra_paths_list or [] - assert version in ('2.6', '2.7'), 'Unsupported pylint version: %s' % version + assert version in ('2.6', '2.7', '2.13'), \ + 'Unsupported pylint version: %s' % version if input_api.is_committing or input_api.no_diffs: error_type = output_api.PresubmitError diff --git a/pylint-2.13 b/pylint-2.13 new file mode 100755 index 000000000..e7c9fb81a --- /dev/null +++ b/pylint-2.13 @@ -0,0 +1,81 @@ +#!/usr/bin/env vpython3 +# Copyright 2019 The Chromium Authors. All rights reserved. +# 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] +# # Third party dependencies. These are only listed because pylint itself needs +# # them. Feel free to add/remove anything here. +# python_version: "3.11" +# +# wheel: < +# name: "infra/python/wheels/futures-py2_py3" +# version: "version:3.1.1" +# > +# wheel: < +# name: "infra/python/wheels/isort-py3" +# version: "version:5.10.1" +# > +# wheel: < +# name: "infra/python/wheels/mccabe-py2_py3" +# version: "version:0.6.1" +# > +# wheel: < +# name: "infra/python/wheels/six-py2_py3" +# version: "version:1.15.0" +# > +# wheel: < +# name: "infra/python/wheels/toml-py3" +# version: "version:0.10.1" +# > +# wheel: < +# name: "infra/python/wheels/wrapt-py3" +# version: "version:1.15.0" +# > +# wheel: < +# name: "infra/python/wheels/lazy-object-proxy/${vpython_platform}" +# version: "version:1.4.3" +# > +# wheel: < +# name: "infra/python/wheels/colorama-py3" +# version: "version:0.4.1" +# > +# +# # Pylint extensions. +# +# wheel: < +# name: "infra/python/wheels/pylint-quotes-py3" +# version: "version:0.2.1" +# > +# +# # Pylint dependencies. +# +# wheel: < +# name: "infra/python/wheels/astroid-py3" +# version: "version:2.11.3" +# > +# wheel: < +# name: "infra/python/wheels/dill-py3" +# version: "version:0.3.4" +# > +# wheel: < +# name: "infra/python/wheels/platformdirs-py3" +# version: "version:3.10.0" +# > +# wheel: < +# name: "infra/python/wheels/pylint-py3" +# version: "version:2.13.8" +# > +# +# [VPYTHON:END] + +import sys + +import pylint_main + +if __name__ == '__main__': + sys.exit(pylint_main.main(sys.argv[1:])) + diff --git a/pylint-2.13.bat b/pylint-2.13.bat new file mode 100644 index 000000000..f631b4816 --- /dev/null +++ b/pylint-2.13.bat @@ -0,0 +1,12 @@ +@echo off +:: Copyright 2021 The Chromium Authors. All rights reserved. +:: Use of this source code is governed by a BSD-style license that can be +:: found in the LICENSE file. +setlocal + +:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used +:: standalone, but allow other PATH manipulations to take priority. +set PATH=%PATH%;%~dp0 + +:: Defer control. +vpython3 "%~dp0\pylint-2.13" %*