Skip to content

Commit 7219a1f

Browse files
committed
pylint: update to 3.2 for Python 3.11
To migrate the codebase to newer Python, we need to update pylint to run with newer Python versions. Bump it to vpython 3.11 and a newer Pylint 3.2. Make some minor code changes to fix new warnings from the new version. Change-Id: Ieab91f27ca84669601f004d4b380a873e0dc908d Reviewed-on: https://chromium-review.googlesource.com/c/apps/libapps/+/6201551 Reviewed-by: Joel Hockey <[email protected]> Tested-by: kokoro <[email protected]>
1 parent 1a0bdbd commit 7219a1f

File tree

3 files changed

+14
-43
lines changed

3 files changed

+14
-43
lines changed

.pylintrc

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22
# Use of this source code is governed by a BSD-style license that can be
33
# found in the LICENSE file.
44

5-
[MASTER]
5+
[MAIN]
66

77
# Use multiple processes to speed up Pylint.
88
jobs = 0
99

1010
# List of plugins (as comma separated values of python modules names) to load,
1111
# usually to register additional checkers.
1212
load-plugins=
13+
pylint.extensions.bad_builtin,
1314
pylint.extensions.docstyle,
1415

15-
# Configure quote preferences.
16-
string-quote = single-avoid-escape
17-
triple-quote = double
18-
docstring-quote = double
19-
2016

2117
[MESSAGES CONTROL]
2218

@@ -25,13 +21,11 @@ disable=
2521
duplicate-code,
2622
fixme,
2723
invalid-name,
28-
locally-enabled,
2924
locally-disabled,
3025
no-else-break,
3126
no-else-continue,
3227
no-else-return,
3328
not-callable,
34-
relative-import,
3529
too-few-public-methods,
3630
too-many-arguments,
3731
too-many-branches,
@@ -67,10 +61,8 @@ bad-functions=
6761
apply,
6862
exit,
6963
filter,
70-
input,
7164
map,
7265
quit,
73-
raw_input,
7466
reduce,
7567

7668

libdot/bin/libdot.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def setup_logging(debug=False, quiet=0):
8080
level = logging.WARNING
8181
elif quiet <= 2:
8282
level = logging.ERROR
83-
elif quiet <= 3:
83+
else: # if quiet <= 3:
8484
level = logging.CRITICAL
8585

8686
formatter = ColoredFormatter(fmt, datefmt)
@@ -119,7 +119,10 @@ def parse_known_args(self, args=None, namespace=None):
119119

120120
def add_common_arguments(self, short_options=True):
121121
"""Add our custom/consistent set of command line flags."""
122-
getopts = lambda *args: args if short_options else args[1:]
122+
123+
def getopts(*args):
124+
return args if short_options else args[1:]
125+
123126
self.add_argument(
124127
*getopts("-d", "--debug"),
125128
action="store_true",

libdot/bin/pylint-vpython

+7-31
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@
99
# network to see if there are any updates.
1010

1111
# [VPYTHON:BEGIN]
12-
# python_version: "3.8"
12+
# python_version: "3.11"
1313
#
1414
# # Third party dependencies. These are only listed because pylint itself needs
1515
# # them. Feel free to add/remove anything here.
1616
#
1717
# wheel: <
1818
# name: "infra/python/wheels/dill-py3"
19-
# version: "version:0.3.4"
20-
# >
21-
# wheel: <
22-
# name: "infra/python/wheels/futures-py3"
23-
# version: "version:3.1.1"
19+
# version: "version:0.3.7"
2420
# >
2521
# wheel: <
2622
# name: "infra/python/wheels/isort-py3"
@@ -32,42 +28,22 @@
3228
# >
3329
# wheel: <
3430
# name: "infra/python/wheels/platformdirs-py3"
35-
# version: "version:2.5.2"
36-
# >
37-
# wheel: <
38-
# name: "infra/python/wheels/six-py3"
39-
# version: "version:1.15.0"
40-
# >
41-
# wheel: <
42-
# name: "infra/python/wheels/toml-py3"
43-
# version: "version:0.10.1"
44-
# >
45-
# wheel: <
46-
# name: "infra/python/wheels/tomli-py3"
47-
# version: "version:2.0.1"
48-
# >
49-
# wheel: <
50-
# name: "infra/python/wheels/wrapt/${vpython_platform}"
51-
# version: "version:1.12.1"
52-
# >
53-
# wheel: <
54-
# name: "infra/python/wheels/lazy-object-proxy/${vpython_platform}"
55-
# version: "version:1.4.3"
31+
# version: "version:3.10.0"
5632
# >
5733
# wheel: <
58-
# name: "infra/python/wheels/typing-extensions-py3"
59-
# version: "version:4.0.1"
34+
# name: "infra/python/wheels/tomlkit-py3"
35+
# version: "version:0.12.3"
6036
# >
6137
#
6238
# # Pylint dependencies.
6339
#
6440
# wheel: <
6541
# name: "infra/python/wheels/astroid-py3"
66-
# version: "version:2.11.3"
42+
# version: "version:3.2.4"
6743
# >
6844
# wheel: <
6945
# name: "infra/python/wheels/pylint-py3"
70-
# version: "version:2.13.8"
46+
# version: "version:3.2.7"
7147
# >
7248
#
7349
# # Random deps we use in the tree.

0 commit comments

Comments
 (0)