From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>,
Alper Nebi Yasak <alpernebiyasak@gmail.com>,
Tom Rini <trini@konsulko.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Aaron Williams <awilliams@marvell.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [PATCH 08/20] py: Bump pylint version and clear warnings
Date: Tue, 11 Jun 2024 22:04:07 +0100 [thread overview]
Message-ID: <20240611-docker-image-v1-8-51472eb70357@flygoat.com> (raw)
In-Reply-To: <20240611-docker-image-v1-0-51472eb70357@flygoat.com>
Bump pylint to 3.2.3 as old versions are not working with
python 3.12.
Clear warnings, mostly E0606: (possibly-used-before-assignment).
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
.azure-pipelines.yml | 2 +-
.gitlab-ci.yml | 2 +-
doc/develop/python_cq.rst | 4 ++--
test/py/tests/test_ums.py | 1 +
test/py/tests/test_usb.py | 1 +
tools/binman/etype/fdtmap.py | 1 +
tools/binman/etype/fit.py | 1 +
| 1 +
tools/binman/etype/pre_load.py | 2 ++
tools/binman/etype/ti_board_config.py | 1 +
tools/binman/etype/x509_cert.py | 1 +
tools/binman/ftest.py | 1 +
tools/binman/state.py | 1 +
tools/buildman/builder.py | 2 ++
tools/microcode-tool.py | 1 +
tools/patman/test_checkpatch.py | 2 ++
tools/qconfig.py | 1 +
17 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 27f69583c655..37b569b13ab0 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -152,7 +152,7 @@ stages:
export USER=azure
pip install -r test/py/requirements.txt
pip install -r tools/buildman/requirements.txt
- pip install asteval pylint==2.12.2 pyopenssl
+ pip install asteval pylint==3.2.3 pyopenssl
export PATH=${PATH}:~/.local/bin
echo "[MASTER]" >> .pylintrc
echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 165f765a8332..18c4c430c63d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -214,7 +214,7 @@ Run pylint:
- git config --global --add safe.directory "${CI_PROJECT_DIR}"
- pip install -r test/py/requirements.txt
- pip install -r tools/buildman/requirements.txt
- - pip install asteval pylint==2.12.2 pyopenssl
+ - pip install asteval pylint==3.2.3 pyopenssl
- export PATH=${PATH}:~/.local/bin
- echo "[MASTER]" >> .pylintrc
- echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
diff --git a/doc/develop/python_cq.rst b/doc/develop/python_cq.rst
index 1e209ff197d6..c8a75a5b7a7b 100644
--- a/doc/develop/python_cq.rst
+++ b/doc/develop/python_cq.rst
@@ -23,7 +23,7 @@ regressions in any module.
To run this locally you should use this version of pylint::
# pylint --version
- pylint 2.11.1
+ pylint 3.2.3
astroid 2.8.6
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0]
@@ -31,7 +31,7 @@ To run this locally you should use this version of pylint::
You should be able to select and this install other required tools with::
- pip install pylint==2.11.1
+ pip install pylint==3.2.3
pip install -r test/py/requirements.txt
pip install asteval pyopenssl
diff --git a/test/py/tests/test_ums.py b/test/py/tests/test_ums.py
index 749b1606235c..55372e42a928 100644
--- a/test/py/tests/test_ums.py
+++ b/test/py/tests/test_ums.py
@@ -118,6 +118,7 @@ def test_ums(u_boot_console, env__usb_dev_port, env__block_devs):
test_f = u_boot_utils.PersistentRandomFile(u_boot_console, 'ums.bin',
1024 * 1024);
+ mounted_test_fn = None
if have_writable_fs_partition:
mounted_test_fn = mount_point + '/' + mount_subdir + test_f.fn
diff --git a/test/py/tests/test_usb.py b/test/py/tests/test_usb.py
index fb3d20f0826b..27105cd1d5e1 100644
--- a/test/py/tests/test_usb.py
+++ b/test/py/tests/test_usb.py
@@ -564,6 +564,7 @@ def test_usb_load(u_boot_console):
part_detect = 1
addr = u_boot_utils.find_ram_base(u_boot_console)
+ file, size = 0, 0
if fs == 'fat':
file, size = test_usb_fatload_fatwrite(u_boot_console)
elif fs == 'ext4':
diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py
index f1f6217940f2..6b4ca497f871 100644
--- a/tools/binman/etype/fdtmap.py
+++ b/tools/binman/etype/fdtmap.py
@@ -106,6 +106,7 @@ class Entry_fdtmap(Entry):
Returns:
FDT map binary data
"""
+ fsw = None
def _AddNode(node):
"""Add a node to the FDT map"""
for pname, prop in node.props.items():
diff --git a/tools/binman/etype/fit.py b/tools/binman/etype/fit.py
index 2c14b15b03cd..dfbb6de7b63e 100644
--- a/tools/binman/etype/fit.py
+++ b/tools/binman/etype/fit.py
@@ -808,6 +808,7 @@ class Entry_fit(Entry_section):
data_size = fdt_util.GetInt(node, "data-size")
# Contents are inside the FIT
+ offset, size = 0, 0
if data_prop is not None:
# GetOffset() returns offset of a fdt_property struct,
# which has 3 fdt32_t members before the actual data.
--git a/tools/binman/etype/image_header.py b/tools/binman/etype/image_header.py
index 240118849580..3db8e61d23a2 100644
--- a/tools/binman/etype/image_header.py
+++ b/tools/binman/etype/image_header.py
@@ -62,6 +62,7 @@ class Entry_image_header(Entry):
def _GetHeader(self):
image_pos = self.GetSiblingImagePos('fdtmap')
+ offset = 0xffffffff
if image_pos == False:
self.Raise("'image_header' section must have an 'fdtmap' sibling")
elif image_pos is None:
diff --git a/tools/binman/etype/pre_load.py b/tools/binman/etype/pre_load.py
index 2e4c72359ff3..c095cf425c93 100644
--- a/tools/binman/etype/pre_load.py
+++ b/tools/binman/etype/pre_load.py
@@ -112,6 +112,8 @@ class Entry_pre_load(Entry_collection):
# Compute the signature
if padding_name is None:
padding_name = "pkcs-1.5"
+
+ padding, padding_args = None, {}
if padding_name == "pss":
salt_len = key.size_in_bytes() - hash_image.digest_size - 2
padding = pss
diff --git a/tools/binman/etype/ti_board_config.py b/tools/binman/etype/ti_board_config.py
index c10d66edcb15..33c7a351c4ea 100644
--- a/tools/binman/etype/ti_board_config.py
+++ b/tools/binman/etype/ti_board_config.py
@@ -118,6 +118,7 @@ class Entry_ti_board_config(Entry_section):
Returns:
array of bytes representing value
"""
+ br = None
size = 0
if (data_type == '#/definitions/u8'):
size = 1
diff --git a/tools/binman/etype/x509_cert.py b/tools/binman/etype/x509_cert.py
index 29630d1b86c8..763cb506399b 100644
--- a/tools/binman/etype/x509_cert.py
+++ b/tools/binman/etype/x509_cert.py
@@ -83,6 +83,7 @@ class Entry_x509_cert(Entry_collection):
output_fname = tools.get_output_filename('cert.%s' % uniq)
input_fname = tools.get_output_filename('input.%s' % uniq)
config_fname = tools.get_output_filename('config.%s' % uniq)
+ stdout = None
tools.write_file(input_fname, input_data)
if type == 'generic':
stdout = self.openssl.x509_cert(
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 567849bbab0f..99fc606bd855 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -6293,6 +6293,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
re_name = re.compile('_binman_(u_boot_(.*))_prop_(.*)')
for name, sym in syms.items():
msg = 'test'
+ expect_val = None
val = elf.GetSymbolValue(sym, edata, msg)
entry_m = re_name.match(name)
if entry_m:
diff --git a/tools/binman/state.py b/tools/binman/state.py
index 45bae40c525a..f43be6d4ce6e 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -406,6 +406,7 @@ def CheckSetHashValue(node, get_data_func):
hash_node = node.FindNode('hash')
if hash_node:
algo = hash_node.props.get('algo').value
+ data = None
if algo == 'sha256':
m = hashlib.sha256()
m.update(get_data_func())
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index f35175b4598d..c8ee00767f01 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -1066,6 +1066,7 @@ class Builder:
printed_target = False
for name in sorted(result):
diff = result[name]
+ color = None
if name.startswith('_'):
continue
if diff != 0:
@@ -1326,6 +1327,7 @@ class Builder:
for line in lines:
if not line:
continue
+ col = None
if line[0] == '+':
col = self.col.GREEN
elif line[0] == '-':
diff --git a/tools/microcode-tool.py b/tools/microcode-tool.py
index 24c02c4fca14..5f0287736dc7 100755
--- a/tools/microcode-tool.py
+++ b/tools/microcode-tool.py
@@ -277,6 +277,7 @@ def MicrocodeTool():
if cmd not in commands:
parser.error("Unknown command '%s'" % cmd)
+ date, license_text, microcodes = None, None, None
if (not not options.mcfile) != (not not options.mcfile):
parser.error("You must specify either header files or a microcode file, not both")
if options.headerfile:
diff --git a/tools/patman/test_checkpatch.py b/tools/patman/test_checkpatch.py
index db7860f551d0..e2f596940d3d 100644
--- a/tools/patman/test_checkpatch.py
+++ b/tools/patman/test_checkpatch.py
@@ -530,4 +530,6 @@ index 0000000..2234c87
if __name__ == "__main__":
unittest.main()
+ # pylint doesn't seem to find this
+ # pylint: disable=E1101
gitutil.RunTests()
diff --git a/tools/qconfig.py b/tools/qconfig.py
index 04118d942da6..2492b37444a3 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -873,6 +873,7 @@ def read_database():
all_defconfigs = set()
defconfig_db = collections.defaultdict(set)
+ defconfig = None
for line in read_file(CONFIG_DATABASE):
line = line.rstrip()
if not line: # Separator between defconfigs
--
2.43.0
next prev parent reply other threads:[~2024-06-11 21:05 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 21:03 [PATCH 00/20] New CI image and fixes Jiaxun Yang
2024-06-11 21:04 ` [PATCH 01/20] py: Replace deprecated unittest APIs Jiaxun Yang
2024-06-11 21:04 ` [PATCH 02/20] binman: Replace pkg_resources with importlib.resources Jiaxun Yang
2024-06-11 21:04 ` [PATCH 03/20] py: Replace distutils.core with setuptools Jiaxun Yang
2024-06-11 21:04 ` [PATCH 04/20] py: Replace usage of configparser.read_fp Jiaxun Yang
2024-06-11 21:04 ` [PATCH 05/20] doc/sphinx: Remove usage of six Jiaxun Yang
2024-06-11 21:04 ` [PATCH 06/20] py: Remove unused entries in requirements.txt Jiaxun Yang
2024-06-11 21:04 ` [PATCH 07/20] py: Bump requirements versions Jiaxun Yang
2024-06-11 21:04 ` Jiaxun Yang [this message]
2024-06-11 21:04 ` [PATCH 09/20] binman: Workaround lz4 cli padding in test cases Jiaxun Yang
2024-06-11 21:04 ` [PATCH 10/20] tests/test_event_dump: Relax match rule for output Jiaxun Yang
2024-06-11 21:04 ` [PATCH 11/20] lib/charset & efi: Fix possible unaligned accesses Jiaxun Yang
2024-06-11 21:04 ` [PATCH 12/20] cyclic: Rise default CYCLIC_MAX_CPU_TIME_US to 5000 Jiaxun Yang
2024-06-12 16:00 ` Tom Rini
2024-06-12 16:13 ` Jiaxun Yang
2024-06-12 16:50 ` Tom Rini
2024-06-14 14:13 ` Stefan Roese
2024-06-17 23:29 ` Tom Rini
2024-06-18 14:00 ` Jiaxun Yang
2024-06-18 14:24 ` Stefan Roese
2024-06-18 14:31 ` Tom Rini
2024-06-18 21:03 ` Tim Harvey
2024-06-19 8:21 ` Rasmus Villemoes
2024-06-19 15:20 ` Tom Rini
2024-06-18 14:01 ` Stefan Roese
2024-06-11 21:04 ` [PATCH 13/20] CI: Ensure pip install is always performed in venv Jiaxun Yang
2024-06-12 16:00 ` Tom Rini
2024-06-11 21:04 ` [PATCH 14/20] CI: GitLab: Split build_world tasks Jiaxun Yang
2024-06-12 16:01 ` Tom Rini
2024-06-12 16:14 ` Jiaxun Yang
2024-06-12 17:07 ` Tom Rini
2024-06-12 20:24 ` Simon Glass
2024-06-13 15:32 ` Tom Rini
2024-06-11 21:04 ` [PATCH 15/20] CI: Dockerfile: Set global git name & email config Jiaxun Yang
2024-06-11 21:04 ` [PATCH 16/20] CI: Dockerfile: Bump various software version Jiaxun Yang
2024-06-12 16:02 ` Tom Rini
2024-06-12 16:19 ` Jiaxun Yang
2024-06-11 21:04 ` [PATCH 17/20] CI: Dockerfile: Add LoongArch64 support Jiaxun Yang
2024-06-11 21:04 ` [PATCH 18/20] doc: ci: Document how to run pipeline on gitlab.com Jiaxun Yang
2024-06-11 21:04 ` [PATCH NFC 19/20] Use Jiaxun's CI Image Jiaxun Yang
2024-06-11 21:04 ` [PATCH NFC 20/20] CI: Dockerfile: Replace some URL with mirror sites Jiaxun Yang
2024-06-12 16:00 ` [PATCH 00/20] New CI image and fixes Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240611-docker-image-v1-8-51472eb70357@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=alpernebiyasak@gmail.com \
--cc=awilliams@marvell.com \
--cc=ilias.apalodimas@linaro.org \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.