summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchip/ish/util/pack_ec.py10
-rwxr-xr-xchip/mchp/util/pack_ec.py4
-rwxr-xr-xchip/mchp/util/pack_ec_mec152x.py26
-rwxr-xr-xchip/mchp/util/pack_ec_mec172x.py42
-rwxr-xr-xchip/mec1322/util/pack_ec.py4
-rw-r--r--cts/common/board.py18
-rwxr-xr-xcts/cts.py4
-rwxr-xr-xextra/cr50_rma_open/cr50_rma_open.py20
-rwxr-xr-xextra/stack_analyzer/stack_analyzer.py8
-rwxr-xr-xextra/stack_analyzer/stack_analyzer_unittest.py6
-rw-r--r--extra/tigertool/ecusb/__init__.py4
-rw-r--r--extra/tigertool/ecusb/pty_driver.py8
-rw-r--r--extra/tigertool/ecusb/stm32uart.py6
-rw-r--r--extra/tigertool/ecusb/stm32usb.py6
-rw-r--r--extra/tigertool/ecusb/tiny_servo_common.py6
-rw-r--r--extra/tigertool/ecusb/tiny_servod.py4
-rwxr-xr-xextra/tigertool/tigertest.py4
-rwxr-xr-xextra/tigertool/tigertool.py4
-rw-r--r--extra/usb_power/convert_power_log_board.py6
-rwxr-xr-xextra/usb_power/convert_servo_ina.py4
-rwxr-xr-xextra/usb_power/powerlog.py15
-rw-r--r--extra/usb_power/powerlog_unittest.py6
-rw-r--r--extra/usb_power/stats_manager.py6
-rw-r--r--extra/usb_power/stats_manager_unittest.py6
-rwxr-xr-xextra/usb_serial/console.py13
-rwxr-xr-xextra/usb_updater/fw_update.py12
-rwxr-xr-xextra/usb_updater/servo_updater.py6
-rwxr-xr-xutil/config_option_check.py4
-rwxr-xr-xutil/ec3po/console.py16
-rwxr-xr-xutil/ec3po/console_unittest.py20
-rwxr-xr-xutil/ec3po/interpreter_unittest.py24
-rw-r--r--util/kconfiglib.py3
-rw-r--r--util/run_ects.py6
-rwxr-xr-xutil/uart_stress_tester.py6
-rwxr-xr-xutil/unpack_ftb.py4
-rw-r--r--zephyr/zmake/tests/conftest.py4
-rw-r--r--zephyr/zmake/tests/test_build_config.py6
-rw-r--r--zephyr/zmake/tests/test_generate_readme.py2
-rw-r--r--zephyr/zmake/tests/test_modules.py4
-rw-r--r--zephyr/zmake/tests/test_packers.py6
-rw-r--r--zephyr/zmake/tests/test_project.py6
-rw-r--r--zephyr/zmake/tests/test_reexec.py2
-rw-r--r--zephyr/zmake/tests/test_toolchains.py2
-rw-r--r--zephyr/zmake/tests/test_util.py6
-rw-r--r--zephyr/zmake/tests/test_zmake.py4
45 files changed, 112 insertions, 271 deletions
diff --git a/chip/ish/util/pack_ec.py b/chip/ish/util/pack_ec.py
index 8dde6ab6a9..e7bb0ce74b 100755
--- a/chip/ish/util/pack_ec.py
+++ b/chip/ish/util/pack_ec.py
@@ -4,10 +4,6 @@
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script to pack EC binary with manifest header according to
# Based on 607297_Host_ISH_Firmware_Load_Chrome_OS_SAS_Rev0p5.pdf,
@@ -34,8 +30,7 @@ def parseargs():
parser.add_argument(
"-k",
"--kernel",
- help="EC kernel binary to pack, \
- usually ec.RW.bin or ec.RW.flat.",
+ help="EC kernel binary to pack, usually ec.RW.bin or ec.RW.flat.",
required=True,
)
parser.add_argument(
@@ -44,8 +39,7 @@ def parseargs():
parser.add_argument(
"-a",
"--aon",
- help="EC aontask binary to pack, \
- usually ish_aontask.bin.",
+ help="EC aontask binary to pack, usually ish_aontask.bin.",
required=False,
)
parser.add_argument(
diff --git a/chip/mchp/util/pack_ec.py b/chip/mchp/util/pack_ec.py
index 15be16c0d4..85aad94bd6 100755
--- a/chip/mchp/util/pack_ec.py
+++ b/chip/mchp/util/pack_ec.py
@@ -3,10 +3,6 @@
# Copyright 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script to pack EC binary into SPI flash image for MEC17xx
# Based on MEC170x_ROM_Description.pdf DS00002225C (07-28-17).
diff --git a/chip/mchp/util/pack_ec_mec152x.py b/chip/mchp/util/pack_ec_mec152x.py
index 89f90f5394..8ef7b3992c 100755
--- a/chip/mchp/util/pack_ec_mec152x.py
+++ b/chip/mchp/util/pack_ec_mec152x.py
@@ -3,10 +3,6 @@
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script to pack EC binary into SPI flash image for MEC152x
# Based on MEC1521/MEC1523_ROM_Description.pdf
@@ -218,13 +214,6 @@ def PadZeroTo(data, size):
#
-# Boot-ROM SPI image encryption not used with Chromebooks
-#
-def EncryptPayload(args, chip_dict, payload):
- return None
-
-
-#
# Build SPI image header for MEC152x
# MEC152x image header size = 320(0x140) bytes
#
@@ -508,9 +497,6 @@ def gen_test_ecrw(pldrw):
def parseargs():
- # TODO I commented this out. Why?
- rpath = os.path.dirname(os.path.relpath(__file__))
-
parser = argparse.ArgumentParser()
parser.add_argument(
"-i",
@@ -778,21 +764,13 @@ def main():
header = BuildHeader2(args, chip_dict, lfw_ecro_len, LOAD_ADDR, lfw_ecro_entry)
printByteArrayAsHex(header, "Header(lfw_ecro)")
- # If payload encryption used then encrypt payload and
- # generate Payload Key Header. If encryption not used
- # payload is not modified and the method returns None
- encryption_key_header = EncryptPayload(args, chip_dict, lfw_ecro)
- printByteArrayAsHex(encryption_key_header, "LFW + EC_RO encryption_key_header")
-
ec_info_block = GenEcInfoBlock(args, chip_dict)
printByteArrayAsHex(ec_info_block, "EC Info Block")
cosignature = GenCoSignature(args, chip_dict, lfw_ecro)
printByteArrayAsHex(cosignature, "LFW + EC_RO cosignature")
- trailer = GenTrailer(
- args, chip_dict, lfw_ecro, encryption_key_header, ec_info_block, cosignature
- )
+ trailer = GenTrailer(args, chip_dict, lfw_ecro, None, ec_info_block, cosignature)
printByteArrayAsHex(trailer, "LFW + EC_RO trailer")
@@ -883,7 +861,7 @@ def main():
assert rw_offset >= offset, print(
"""Offset of EC_RW at {0:08x} overlaps end
- of EC_RO at {0:08x}""".format(
+ of EC_RO at {1:08x}""".format(
rw_offset, offset
)
)
diff --git a/chip/mchp/util/pack_ec_mec172x.py b/chip/mchp/util/pack_ec_mec172x.py
index bd5ff6edba..25a4cb7ed1 100755
--- a/chip/mchp/util/pack_ec_mec172x.py
+++ b/chip/mchp/util/pack_ec_mec172x.py
@@ -3,10 +3,6 @@
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script to pack EC binary into SPI flash image for MEC172x
# Based on MEC172x_ROM_Description.pdf revision 6/8/2020
@@ -121,8 +117,9 @@ def GetEntryPoint(payload_file):
return int.from_bytes(s, byteorder="little")
-def GetPayloadFromOffset(payload_file, offset, padsize):
- """Read payload and pad it to padsize."""
+def GetPayloadFromOffset(payload_file, offset, chip_dict):
+ """Read payload and pad it to chip_dict["PAD_SIZE"]."""
+ padsize = chip_dict["PAD_SIZE"]
with open(payload_file, "rb") as f:
f.seek(offset)
payload = bytearray(f.read())
@@ -134,15 +131,15 @@ def GetPayloadFromOffset(payload_file, offset, padsize):
)
if rem_len:
- payload += PAYLOAD_PAD_BYTE * (padsize - rem_len)
+ payload += chip_dict["PAYLOAD_PAD_BYTE"] * (padsize - rem_len)
debug_print("GetPayload: Added {0} padding bytes".format(padsize - rem_len))
return payload
-def GetPayload(payload_file, padsize):
- """Read payload and pad it to padsize"""
- return GetPayloadFromOffset(payload_file, 0, padsize)
+def GetPayload(payload_file, chip_dict):
+ """Read payload and pad it to chip_dict["PAD_SIZE"]"""
+ return GetPayloadFromOffset(payload_file, 0, chip_dict)
def GetPublicKey(pem_file):
@@ -226,13 +223,6 @@ def PadZeroTo(data, size):
#
-# Boot-ROM SPI image encryption not used with Chromebooks
-#
-def EncryptPayload(args, chip_dict, payload):
- return None
-
-
-#
# Build SPI image header for MEC172x
# MEC172x image header size = 320(0x140) bytes
#
@@ -797,16 +787,16 @@ def main():
rorofile = PacklfwRoImage(args.input, args.loader_file, args.image_size)
debug_print("Temporary file containing LFW + EC_RO is ", rorofile)
- lfw_ecro = GetPayload(rorofile, chip_dict["PAD_SIZE"])
+ lfw_ecro = GetPayload(rorofile, chip_dict)
lfw_ecro_len = len(lfw_ecro)
debug_print("Padded LFW + EC_RO length = ", hex(lfw_ecro_len))
# SPI test mode compute CRC32 of EC_RO and store in last 4 bytes
if args.test_spi:
- crc32_ecro = zlib.crc32(bytes(lfw_ecro[LFW_SIZE:-4]))
+ crc32_ecro = zlib.crc32(bytes(lfw_ecro[args.lfw_size : -4]))
crc32_ecro_bytes = crc32_ecro.to_bytes(4, byteorder="little")
lfw_ecro[-4:] = crc32_ecro_bytes
- debug_print("ecro len = ", hex(len(lfw_ecro) - LFW_SIZE))
+ debug_print("ecro len = ", hex(len(lfw_ecro) - args.lfw_size))
debug_print("CRC32(ecro-4) = ", hex(crc32_ecro))
# Reads entry point from offset 4 of file.
@@ -825,21 +815,13 @@ def main():
header = BuildHeader2(args, chip_dict, lfw_ecro_len, args.load_addr, lfw_ecro_entry)
printByteArrayAsHex(header, "Header(lfw_ecro)")
- # If payload encryption used then encrypt payload and
- # generate Payload Key Header. If encryption not used
- # payload is not modified and the method returns None
- encryption_key_header = EncryptPayload(args, chip_dict, lfw_ecro)
- printByteArrayAsHex(encryption_key_header, "LFW + EC_RO encryption_key_header")
-
ec_info_block = GenEcInfoBlock(args, chip_dict)
printByteArrayAsHex(ec_info_block, "EC Info Block")
cosignature = GenCoSignature(args, chip_dict, lfw_ecro)
printByteArrayAsHex(cosignature, "LFW + EC_RO cosignature")
- trailer = GenTrailer(
- args, chip_dict, lfw_ecro, encryption_key_header, ec_info_block, cosignature
- )
+ trailer = GenTrailer(args, chip_dict, lfw_ecro, None, ec_info_block, cosignature)
printByteArrayAsHex(trailer, "LFW + EC_RO trailer")
@@ -851,7 +833,7 @@ def main():
debug_print("args.input = ", args.input)
debug_print("args.image_size = ", hex(args.image_size))
- ecrw = GetPayloadFromOffset(args.input, args.image_size, chip_dict["PAD_SIZE"])
+ ecrw = GetPayloadFromOffset(args.input, args.image_size, chip_dict)
debug_print("type(ecrw) is ", type(ecrw))
debug_print("len(ecrw) is ", hex(len(ecrw)))
diff --git a/chip/mec1322/util/pack_ec.py b/chip/mec1322/util/pack_ec.py
index 736f9efcac..44ba6e7854 100755
--- a/chip/mec1322/util/pack_ec.py
+++ b/chip/mec1322/util/pack_ec.py
@@ -3,10 +3,6 @@
# Copyright 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script to pack EC binary into SPI flash image for MEC1322
# Based on MEC1322_ROM_Doc_Rev0.5.pdf.
diff --git a/cts/common/board.py b/cts/common/board.py
index f62d7bdfc5..68071f0b28 100644
--- a/cts/common/board.py
+++ b/cts/common/board.py
@@ -1,10 +1,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# Note: This is a py2/3 compatible file.
@@ -15,7 +11,7 @@ import shutil
import subprocess as sp
from abc import ABCMeta, abstractmethod
-import serial
+import serial # pylint:disable=import-error
import six
OCD_SCRIPT_DIR = "/usr/share/openocd/scripts"
@@ -77,12 +73,16 @@ class Board(six.with_metaclass(ABCMeta, object)):
self.hla_serial = hla_serial
self.tty_port = None
self.tty = None
+ self.log_dir = None
+ self.openocd_log = os.devnull
+ self.build_log = os.devnull
def reset_log_dir(self):
"""Reset log directory."""
- if os.path.isdir(self.log_dir):
- shutil.rmtree(self.log_dir)
- os.makedirs(self.log_dir)
+ if self.log_dir:
+ if os.path.isdir(self.log_dir):
+ shutil.rmtree(self.log_dir)
+ os.makedirs(self.log_dir)
@staticmethod
def get_stlink_serials():
@@ -394,7 +394,7 @@ class DeviceUnderTest(Board):
# If len(dut) is 0 then your dut doesn't use an st-link device, so we
# don't have to worry about its serial number
if not dut:
- msg = "Failed to find serial for DUT.\n" "Is " + self.board + " connected?"
+ msg = "Failed to find serial for DUT.\nIs " + self.board + " connected?"
raise RuntimeError(msg)
if len(dut) > 1:
msg = (
diff --git a/cts/cts.py b/cts/cts.py
index ebc526c701..b29c849c0c 100755
--- a/cts/cts.py
+++ b/cts/cts.py
@@ -3,10 +3,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# A script which builds, flashes, and runs EC CTS
#
diff --git a/extra/cr50_rma_open/cr50_rma_open.py b/extra/cr50_rma_open/cr50_rma_open.py
index b77b8f3dbb..47cb7cd6e3 100755
--- a/extra/cr50_rma_open/cr50_rma_open.py
+++ b/extra/cr50_rma_open/cr50_rma_open.py
@@ -50,16 +50,14 @@ import subprocess
import sys
import time
-import serial
+import serial # pylint:disable=import-error
SCRIPT_VERSION = 5
CCD_IS_UNRESTRICTED = 1 << 0
WP_IS_DISABLED = 1 << 1
TESTLAB_IS_ENABLED = 1 << 2
RMA_OPENED = CCD_IS_UNRESTRICTED | WP_IS_DISABLED
-URL = (
- "https://www.google.com/chromeos/partner/console/cr50reset?" "challenge=%s&hwid=%s"
-)
+URL = "https://www.google.com/chromeos/partner/console/cr50reset?challenge=%s&hwid=%s"
RMA_SUPPORT_PROD = "0.3.3"
RMA_SUPPORT_PREPVT = "0.4.5"
DEV_MODE_OPEN_PROD = "0.3.9"
@@ -398,7 +396,7 @@ class RMAOpen(object):
self.send_cmd_get_output("ccd open")
logging.info("Enabling testlab mode reqires pressing the power button.")
logging.info(
- "Once the process starts keep tapping the power button " "for 10 seconds."
+ "Once the process starts keep tapping the power button for 10 seconds."
)
input("Press Enter when you're ready to start...")
end_time = time.time() + 15
@@ -473,11 +471,11 @@ class RMAOpen(object):
rma_support,
)
if not self.is_prepvt and self._running_version_is_older(TESTLAB_PROD):
- raise ValueError("Update cr50. No testlab support in old prod " "images.")
+ raise ValueError("Update cr50. No testlab support in old prod images.")
if self._running_version_is_older(rma_support):
raise ValueError(
- "%s does not have RMA support. Update to at "
- "least %s" % (version, rma_support)
+ "%s does not have RMA support. Update to at least %s"
+ % (version, rma_support)
)
def _running_version_is_older(self, target_ver):
@@ -538,7 +536,7 @@ class RMAOpen(object):
return
logging.warning(DEBUG_CONNECTION)
raise ValueError(
- "Found USB device, but could not communicate with " "cr50 console"
+ "Found USB device, but could not communicate with cr50 console"
)
def print_platform_info(self):
@@ -578,7 +576,7 @@ class RMAOpen(object):
logging.info("CCD is still restricted.")
logging.info("Run cr50_rma_open.py -g -i $HWID to generate a url")
logging.info(
- "Run cr50_rma_open.py -a $AUTHCODE to open cr50 with " "an authcode"
+ "Run cr50_rma_open.py -a $AUTHCODE to open cr50 with an authcode"
)
elif not self.check(WP_IS_DISABLED):
logging.info("WP is still enabled.")
@@ -692,7 +690,7 @@ def main(argv):
"open. Run through the rma open process first"
)
if tried_authcode:
- logging.warning("RMA Open did not disable write protect. File a " "bug")
+ logging.warning("RMA Open did not disable write protect. File a bug")
logging.warning("Trying to disable it manually")
cr50_rma_open.wp_disable()
diff --git a/extra/stack_analyzer/stack_analyzer.py b/extra/stack_analyzer/stack_analyzer.py
index 17b2651972..9feb2423c9 100755
--- a/extra/stack_analyzer/stack_analyzer.py
+++ b/extra/stack_analyzer/stack_analyzer.py
@@ -2,10 +2,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Statically analyze stack usage of EC firmware.
@@ -26,7 +22,7 @@ import os
import re
import subprocess
-import yaml
+import yaml # pylint:disable=import-error
SECTION_RO = "RO"
SECTION_RW = "RW"
@@ -1165,7 +1161,7 @@ class StackAnalyzer(object):
if not name:
raise StackAnalyzerError(
- "Cannot find function for address %s.", hex(val)
+ "Cannot find function for address %s." % hex(val)
)
output.append((name, None, None))
diff --git a/extra/stack_analyzer/stack_analyzer_unittest.py b/extra/stack_analyzer/stack_analyzer_unittest.py
index ad2837a8a4..228b7e010e 100755
--- a/extra/stack_analyzer/stack_analyzer_unittest.py
+++ b/extra/stack_analyzer/stack_analyzer_unittest.py
@@ -2,10 +2,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Tests for Stack Analyzer classes and functions."""
@@ -15,7 +11,7 @@ import os
import subprocess
import unittest
-import mock
+import mock # pylint:disable=import-error
import stack_analyzer as sa
diff --git a/extra/tigertool/ecusb/__init__.py b/extra/tigertool/ecusb/__init__.py
index 7a48fdb360..7228f2b911 100644
--- a/extra/tigertool/ecusb/__init__.py
+++ b/extra/tigertool/ecusb/__init__.py
@@ -1,9 +1,5 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
__all__ = ["tiny_servo_common", "stm32usb", "stm32uart", "pty_driver"]
diff --git a/extra/tigertool/ecusb/pty_driver.py b/extra/tigertool/ecusb/pty_driver.py
index 037ff8d529..c87378b94d 100644
--- a/extra/tigertool/ecusb/pty_driver.py
+++ b/extra/tigertool/ecusb/pty_driver.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""ptyDriver class
@@ -19,8 +15,8 @@ import fcntl
import os
import time
-import pexpect
-from pexpect import fdpexpect
+import pexpect # pylint:disable=import-error
+from pexpect import fdpexpect # pylint:disable=import-error
# Expecting a result in 3 seconds is plenty even for slow platforms.
DEFAULT_UART_TIMEOUT = 3
diff --git a/extra/tigertool/ecusb/stm32uart.py b/extra/tigertool/ecusb/stm32uart.py
index 5794bd091b..a6fa73970d 100644
--- a/extra/tigertool/ecusb/stm32uart.py
+++ b/extra/tigertool/ecusb/stm32uart.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Allow creation of uart/console interface via stm32 usb endpoint."""
@@ -18,7 +14,7 @@ import threading
import time
import tty
-import usb
+import usb # pylint:disable=import-error
from . import stm32usb
diff --git a/extra/tigertool/ecusb/stm32usb.py b/extra/tigertool/ecusb/stm32usb.py
index 4b2b23fbac..e8a0bc4f9b 100644
--- a/extra/tigertool/ecusb/stm32usb.py
+++ b/extra/tigertool/ecusb/stm32usb.py
@@ -1,14 +1,10 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Allows creation of an interface via stm32 usb."""
-import usb
+import usb # pylint:disable=import-error
class SusbError(Exception):
diff --git a/extra/tigertool/ecusb/tiny_servo_common.py b/extra/tigertool/ecusb/tiny_servo_common.py
index 599bae80dc..889abcc0a0 100644
--- a/extra/tigertool/ecusb/tiny_servo_common.py
+++ b/extra/tigertool/ecusb/tiny_servo_common.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Utilities for using lightweight console functions."""
@@ -15,7 +11,7 @@ import sys
import time
import six
-import usb
+import usb # pylint:disable=import-error
from . import pty_driver, stm32uart
diff --git a/extra/tigertool/ecusb/tiny_servod.py b/extra/tigertool/ecusb/tiny_servod.py
index ca5ca63f31..d5d092c996 100644
--- a/extra/tigertool/ecusb/tiny_servod.py
+++ b/extra/tigertool/ecusb/tiny_servod.py
@@ -1,10 +1,6 @@
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Helper class to facilitate communication to servo ec console."""
diff --git a/extra/tigertool/tigertest.py b/extra/tigertool/tigertest.py
index 8f8b2c7f03..924ec8c97c 100755
--- a/extra/tigertool/tigertest.py
+++ b/extra/tigertool/tigertest.py
@@ -2,10 +2,6 @@
# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Smoke test of tigertool binary."""
diff --git a/extra/tigertool/tigertool.py b/extra/tigertool/tigertool.py
index 37b7b01495..241e7fe155 100755
--- a/extra/tigertool/tigertool.py
+++ b/extra/tigertool/tigertool.py
@@ -2,10 +2,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Script to control tigertail USB-C Mux board."""
diff --git a/extra/usb_power/convert_power_log_board.py b/extra/usb_power/convert_power_log_board.py
index c1b25f57db..159b4621d7 100644
--- a/extra/usb_power/convert_power_log_board.py
+++ b/extra/usb_power/convert_power_log_board.py
@@ -2,10 +2,6 @@
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""
Program to convert sweetberry config to servod config template.
@@ -19,7 +15,7 @@ import json
import os
import sys
-from powerlog import Spower
+from powerlog import Spower # pylint:disable=import-error
def fetch_records(board_file):
diff --git a/extra/usb_power/convert_servo_ina.py b/extra/usb_power/convert_servo_ina.py
index 6ccd474e6c..c18b7368dc 100755
--- a/extra/usb_power/convert_servo_ina.py
+++ b/extra/usb_power/convert_servo_ina.py
@@ -2,10 +2,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Program to convert power logging config from a servo_ina device
to a sweetberry config.
diff --git a/extra/usb_power/powerlog.py b/extra/usb_power/powerlog.py
index d893e5c6b9..44dd6ec12f 100755
--- a/extra/usb_power/powerlog.py
+++ b/extra/usb_power/powerlog.py
@@ -2,10 +2,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Program to fetch power logging data from a sweetberry device
or other usb device that exports a USB power logging interface.
@@ -27,8 +23,8 @@ import time
import traceback
from distutils import sysconfig
-import usb
-from stats_manager import StatsManager
+import usb # pylint:disable=import-error
+from stats_manager import StatsManager # pylint:disable=import-error
# Directory where hdctools installs configuration files into.
LIB_DIR = os.path.join(sysconfig.get_python_lib(standard_lib=False), "servo", "data")
@@ -182,11 +178,7 @@ class Spower(object):
if dev is None:
raise Exception("Power", "USB device(%s) not found" % serialname)
else:
- try:
- dev = dev_list[0]
- except TypeError:
- # Incompatible pyUsb version.
- dev = dev_list.next()
+ dev = dev_list[0]
self._logger.debug("Found USB device: %04x:%04x", vendor, product)
self._dev = dev
@@ -728,6 +720,7 @@ class powerlog(object):
if integration_us != integration_us_new:
raise Exception(
"FAIL",
+ # pylint:disable=bad-string-format-type
"Integration on A: %dus != integration on B %dus"
% (integration_us, integration_us_new),
)
diff --git a/extra/usb_power/powerlog_unittest.py b/extra/usb_power/powerlog_unittest.py
index 693826c16d..220ff350d2 100644
--- a/extra/usb_power/powerlog_unittest.py
+++ b/extra/usb_power/powerlog_unittest.py
@@ -1,10 +1,6 @@
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Unit tests for powerlog."""
@@ -13,7 +9,7 @@ import shutil
import tempfile
import unittest
-import powerlog
+from usb_power import powerlog
class TestPowerlog(unittest.TestCase):
diff --git a/extra/usb_power/stats_manager.py b/extra/usb_power/stats_manager.py
index 633312311d..0f92916251 100644
--- a/extra/usb_power/stats_manager.py
+++ b/extra/usb_power/stats_manager.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Calculates statistics for lists of data and pretty print them."""
@@ -18,7 +14,7 @@ import logging
import math
import os
-import numpy
+import numpy # pylint:disable=import-error
STATS_PREFIX = "@@"
NAN_TAG = "*"
diff --git a/extra/usb_power/stats_manager_unittest.py b/extra/usb_power/stats_manager_unittest.py
index 37a472af98..2a7317546c 100644
--- a/extra/usb_power/stats_manager_unittest.py
+++ b/extra/usb_power/stats_manager_unittest.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Unit tests for StatsManager."""
@@ -17,7 +13,7 @@ import shutil
import tempfile
import unittest
-import stats_manager
+import stats_manager # pylint:disable=import-error
class TestStatsManager(unittest.TestCase):
diff --git a/extra/usb_serial/console.py b/extra/usb_serial/console.py
index c08cb72092..839330d86a 100755
--- a/extra/usb_serial/console.py
+++ b/extra/usb_serial/console.py
@@ -2,10 +2,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Allow creation of uart/console interface via usb google serial endpoint."""
@@ -23,7 +19,7 @@ import time
import tty
try:
- import usb
+ import usb # pylint:disable=import-error
except ModuleNotFoundError:
print("import usb failed")
print("try running these commands:")
@@ -113,12 +109,7 @@ class Susb:
try:
dev = dev_list[0]
except:
- try:
- dev = dev_list.next()
- except:
- raise SusbError(
- "USB device %04x:%04x not found" % (vendor, product)
- )
+ raise SusbError("USB device %04x:%04x not found" % (vendor, product))
# If we can't set configuration, it's already been set.
try:
diff --git a/extra/usb_updater/fw_update.py b/extra/usb_updater/fw_update.py
index f05797bfb6..8658d92c48 100755
--- a/extra/usb_updater/fw_update.py
+++ b/extra/usb_updater/fw_update.py
@@ -2,10 +2,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# Upload firmware over USB
# Note: This is a py2/3 compatible file.
@@ -21,7 +17,8 @@ import sys
import time
from pprint import pprint
-import usb
+import usb # pylint:disable=import-error
+from ecusb.stm32usb import SusbError
debug = False
@@ -91,10 +88,7 @@ class Supdate(object):
if dev is None:
raise SusbError("USB device(%s) not found" % serialname)
else:
- try:
- dev = dev_list[0]
- except:
- dev = dev_list.next()
+ dev = dev_list[0]
debuglog("Found stm32: %04x:%04x" % (vendor, product))
self._dev = dev
diff --git a/extra/usb_updater/servo_updater.py b/extra/usb_updater/servo_updater.py
index 5402af70aa..7fa4608289 100755
--- a/extra/usb_updater/servo_updater.py
+++ b/extra/usb_updater/servo_updater.py
@@ -2,10 +2,6 @@
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# Note: This is a py2/3 compatible file.
@@ -410,7 +406,7 @@ def main():
# If the user only cares about the information then just print it here,
# and exit.
if args.print_only:
- output = ("board: %s\n" "channel: %s\n" "firmware: %s") % (
+ output = ("board: %s\nchannel: %s\nfirmware: %s") % (
args.board,
args.channel,
newvers,
diff --git a/util/config_option_check.py b/util/config_option_check.py
index 0b05b64091..8263e61709 100755
--- a/util/config_option_check.py
+++ b/util/config_option_check.py
@@ -2,10 +2,6 @@
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Configuration Option Checker.
diff --git a/util/ec3po/console.py b/util/ec3po/console.py
index 33fa5a6775..3b3c1c89f5 100755
--- a/util/ec3po/console.py
+++ b/util/ec3po/console.py
@@ -776,9 +776,7 @@ class Console(object):
self.input_buffer_pos += count
else:
- raise AssertionError(
- ("The only valid directions are 'left' and " "'right'")
- )
+ raise AssertionError(("The only valid directions are 'left' and 'right'"))
self.logger.debug("input_buffer_pos: %d", self.input_buffer_pos)
# Move the cursor.
@@ -1149,11 +1147,11 @@ def main(argv):
"""
# Set up argument parser.
parser = argparse.ArgumentParser(
- description=("Start interactive EC console " "and interpreter.")
+ description=("Start interactive EC console and interpreter.")
)
parser.add_argument(
"ec_uart_pty",
- help=("The full PTY name that the EC UART" " is present on. eg: /dev/pts/12"),
+ help=("The full PTY name that the EC UART is present on. eg: /dev/pts/12"),
)
parser.add_argument(
"--log-level", default="info", help="info, debug, warning, error, or critical"
@@ -1181,7 +1179,7 @@ def main(argv):
# entry.
logging.basicConfig(
level=log_level,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create some pipes to communicate between the interpreter and the console.
@@ -1213,7 +1211,11 @@ def main(argv):
)
# Create a console.
console = Console(
- controller_pty, os.ttyname(user_pty), cmd_pipe_interactive, dbg_pipe_interactive
+ controller_pty,
+ os.ttyname(user_pty),
+ os.ttyname(controller_pty),
+ cmd_pipe_interactive,
+ dbg_pipe_interactive,
)
# Start serving the console.
v = threadproc_shim.Value(ctypes.c_bool, False)
diff --git a/util/ec3po/console_unittest.py b/util/ec3po/console_unittest.py
index 41ae324ef4..45ab2ff44c 100755
--- a/util/ec3po/console_unittest.py
+++ b/util/ec3po/console_unittest.py
@@ -14,7 +14,7 @@ import logging
import tempfile
import unittest
-import mock
+import mock # pylint:disable=import-error
import six
from ec3po import console, interpreter, threadproc_shim
@@ -188,7 +188,7 @@ class TestConsoleEditingMethods(unittest.TestCase):
# Setup logging with a timestamp, the module, and the log level.
logging.basicConfig(
level=logging.DEBUG,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create a temp file and set both the controller and peripheral PTYs to the
@@ -1101,7 +1101,7 @@ class TestConsoleCompatibility(unittest.TestCase):
# Setup logging with a timestamp, the module, and the log level.
logging.basicConfig(
level=logging.DEBUG,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create a temp file and set both the controller and peripheral PTYs to the
# file to create a loopback.
@@ -1207,7 +1207,7 @@ class TestConsoleCompatibility(unittest.TestCase):
# At this point, we should have negotiated to enhanced.
self.assertTrue(
- self.console.enhanced_ec, msg=("Did not negotiate to " "enhanced EC image.")
+ self.console.enhanced_ec, msg=("Did not negotiate to enhanced EC image.")
)
# The command would have been dropped however, so verify this...
@@ -1259,7 +1259,7 @@ class TestConsoleCompatibility(unittest.TestCase):
# Verify this.
self.assertFalse(
self.console.enhanced_ec,
- msg=("Did not negotiate to" "non-enhanced EC image."),
+ msg=("Did not negotiate to non-enhanced EC image."),
)
CheckInputBuffer(self, b"")
CheckInputBufferPosition(self, 0)
@@ -1398,7 +1398,7 @@ class TestOOBMConsoleCommands(unittest.TestCase):
# Setup logging with a timestamp, the module, and the log level.
logging.basicConfig(
level=logging.DEBUG,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create a temp file and set both the controller and peripheral PTYs to the
# file to create a loopback.
@@ -1470,7 +1470,7 @@ class TestOOBMConsoleCommands(unittest.TestCase):
# The EC image should be assumed to be not enhanced.
self.assertFalse(
self.console.enhanced_ec,
- "The image should be assumed to" " be NOT enhanced.",
+ "The image should be assumed to be NOT enhanced.",
)
# Reset the mocks.
@@ -1520,7 +1520,7 @@ class TestOOBMConsoleCommands(unittest.TestCase):
# The EC image should be assumed to be not enhanced.
self.assertFalse(
self.console.enhanced_ec,
- "The image should be assumed to" " be NOT enhanced.",
+ "The image should be assumed to be NOT enhanced.",
)
# Reset the mocks.
@@ -1575,7 +1575,7 @@ class TestOOBMConsoleCommands(unittest.TestCase):
# The EC image should be assumed to be not enhanced.
self.assertFalse(
self.console.enhanced_ec,
- "The image should be assumed to" " be NOT enhanced.",
+ "The image should be assumed to be NOT enhanced.",
)
# Now, let's try to assume that the image is enhanced while still disabling
@@ -1623,7 +1623,7 @@ class TestOOBMConsoleCommands(unittest.TestCase):
# The EC image should be assumed to be enhanced.
self.assertTrue(
- self.console.enhanced_ec, "The image should be" " assumed to be enhanced."
+ self.console.enhanced_ec, "The image should be assumed to be enhanced."
)
diff --git a/util/ec3po/interpreter_unittest.py b/util/ec3po/interpreter_unittest.py
index 509b90f667..73188fab9f 100755
--- a/util/ec3po/interpreter_unittest.py
+++ b/util/ec3po/interpreter_unittest.py
@@ -13,7 +13,7 @@ import logging
import tempfile
import unittest
-import mock
+import mock # pylint:disable=import-error
import six
from ec3po import interpreter, threadproc_shim
@@ -32,7 +32,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
# Setup logging with a timestamp, the module, and the log level.
logging.basicConfig(
level=logging.DEBUG,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create a tempfile that would represent the EC UART PTY.
@@ -226,7 +226,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
# enhanced.
self.assertFalse(
self.itpr.enhanced_ec,
- msg=("State of enhanced_ec upon" " init is not False."),
+ msg=("State of enhanced_ec upon init is not False."),
)
# Assume an interrogation request comes in from the user.
@@ -238,7 +238,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
# The state of enhanced_ec should not be changed yet because we haven't
# received a valid response yet.
self.assertFalse(
- self.itpr.enhanced_ec, msg=("State of enhanced_ec is " "not False.")
+ self.itpr.enhanced_ec, msg=("State of enhanced_ec is not False.")
)
# Assume that the EC responds with an EC_ACK.
@@ -247,9 +247,7 @@ class TestEnhancedECBehaviour(unittest.TestCase):
# Now, the interrogation should be complete and we should know that the
# current EC image is enhanced.
- self.assertFalse(
- self.itpr.interrogating, msg=("interrogating should be " "False")
- )
+ self.assertFalse(self.itpr.interrogating, msg=("interrogating should be False"))
self.assertTrue(self.itpr.enhanced_ec, msg="enhanced_ec sholud be True")
# Now let's perform another interrogation, but pretend that the EC ignores
@@ -281,7 +279,7 @@ class TestUARTDisconnection(unittest.TestCase):
# Setup logging with a timestamp, the module, and the log level.
logging.basicConfig(
level=logging.DEBUG,
- format=("%(asctime)s - %(module)s -" " %(levelname)s - %(message)s"),
+ format=("%(asctime)s - %(module)s - %(levelname)s - %(message)s"),
)
# Create a tempfile that would represent the EC UART PTY.
@@ -307,7 +305,7 @@ class TestUARTDisconnection(unittest.TestCase):
# First, check that interpreter is initialized to connected.
self.assertTrue(
self.itpr.connected,
- ("The interpreter should be" " initialized in a connected state"),
+ ("The interpreter should be initialized in a connected state"),
)
def test_DisconnectStopsECTraffic(self):
@@ -318,7 +316,7 @@ class TestUARTDisconnection(unittest.TestCase):
# Verify interpreter is disconnected from EC.
self.assertFalse(
- self.itpr.connected, ("The interpreter should be" "disconnected.")
+ self.itpr.connected, ("The interpreter should be disconnected.")
)
# Verify that the EC UART is no longer a member of the inputs. The
# interpreter will never pull data from the EC if it's not a member of the
@@ -335,7 +333,7 @@ class TestUARTDisconnection(unittest.TestCase):
# Verify interpreter is disconnected from EC.
self.assertFalse(
- self.itpr.connected, ("The interpreter should be" "disconnected.")
+ self.itpr.connected, ("The interpreter should be disconnected.")
)
# Verify that the EC UART is no longer a member of the inputs nor outputs.
self.assertFalse(self.itpr.ec_uart_pty in self.itpr.inputs)
@@ -372,7 +370,7 @@ class TestUARTDisconnection(unittest.TestCase):
# Verify interpreter is disconnected.
self.assertFalse(
- self.itpr.connected, ("The interpreter should be" "disconnected.")
+ self.itpr.connected, ("The interpreter should be disconnected.")
)
# Verify that the EC UART is no longer a member of the inputs nor outputs.
self.assertFalse(self.itpr.ec_uart_pty in self.itpr.inputs)
@@ -385,7 +383,7 @@ class TestUARTDisconnection(unittest.TestCase):
self.itpr.HandleUserData()
# Verify interpreter is connected.
- self.assertTrue(self.itpr.connected, ("The interpreter should be" "connected."))
+ self.assertTrue(self.itpr.connected, ("The interpreter should be connected."))
# Verify that the EC UART is now a member of the inputs.
self.assertTrue(self.itpr.ec_uart_pty in self.itpr.inputs)
# Since we have issued no commands during the disconnected state, no
diff --git a/util/kconfiglib.py b/util/kconfiglib.py
index a0033bba2d..dabd03d8ca 100644
--- a/util/kconfiglib.py
+++ b/util/kconfiglib.py
@@ -1,6 +1,9 @@
# Copyright (c) 2011-2019, Ulf Magnusson
# SPDX-License-Identifier: ISC
+# Third-party code, ignore pylint problems
+# pylint:disable=all
+
"""
Overview
========
diff --git a/util/run_ects.py b/util/run_ects.py
index 9293f60779..cf32184462 100644
--- a/util/run_ects.py
+++ b/util/run_ects.py
@@ -1,10 +1,6 @@
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""Run all eCTS tests and publish results."""
@@ -44,7 +40,7 @@ class CtsRunner(object):
def run(self, tests):
for test in tests:
- logging.info("Running", test, "test.")
+ logging.info("Running %s test.", test)
self.run_test(test)
def sync(self):
diff --git a/util/uart_stress_tester.py b/util/uart_stress_tester.py
index a89fe730c9..c44262016c 100755
--- a/util/uart_stress_tester.py
+++ b/util/uart_stress_tester.py
@@ -3,10 +3,6 @@
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
"""ChromeOS Uart Stress Test
@@ -32,7 +28,7 @@ import sys
import threading
import time
-import serial
+import serial # pylint:disable=import-error
BAUDRATE = 115200 # Default baudrate setting for UART port
CROS_USERNAME = "root" # Account name to login to ChromeOS
diff --git a/util/unpack_ftb.py b/util/unpack_ftb.py
index a68662d82b..04ba0ed538 100755
--- a/util/unpack_ftb.py
+++ b/util/unpack_ftb.py
@@ -2,10 +2,6 @@
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-#
-# Ignore indention messages, since legacy scripts use 2 spaces instead of 4.
-# pylint: disable=bad-indentation,docstring-section-indent
-# pylint: disable=docstring-trailing-quotes
# Note: This is a py2/3 compatible file.
diff --git a/zephyr/zmake/tests/conftest.py b/zephyr/zmake/tests/conftest.py
index be1de01401..9c10c88b31 100644
--- a/zephyr/zmake/tests/conftest.py
+++ b/zephyr/zmake/tests/conftest.py
@@ -7,8 +7,8 @@
import os
import pathlib
-import hypothesis
-import pytest
+import hypothesis # pylint:disable=import-error
+import pytest # pylint:disable=import-error
import zmake.zmake as zm
hypothesis.settings.register_profile(
diff --git a/zephyr/zmake/tests/test_build_config.py b/zephyr/zmake/tests/test_build_config.py
index f79ed1f8a0..88291cbd05 100644
--- a/zephyr/zmake/tests/test_build_config.py
+++ b/zephyr/zmake/tests/test_build_config.py
@@ -10,9 +10,9 @@ import pathlib
import string
import tempfile
-import hypothesis
-import hypothesis.strategies as st
-import pytest
+import hypothesis # pylint:disable=import-error
+import hypothesis.strategies as st # pylint:disable=import-error
+import pytest # pylint:disable=import-error
import zmake.jobserver
import zmake.util as util
from zmake.build_config import BuildConfig
diff --git a/zephyr/zmake/tests/test_generate_readme.py b/zephyr/zmake/tests/test_generate_readme.py
index 2149b3fc6e..882b9c81ca 100644
--- a/zephyr/zmake/tests/test_generate_readme.py
+++ b/zephyr/zmake/tests/test_generate_readme.py
@@ -6,7 +6,7 @@
Tests for the generate_readme.py file.
"""
-import pytest
+import pytest # pylint:disable=import-error
import zmake.generate_readme as gen_readme
diff --git a/zephyr/zmake/tests/test_modules.py b/zephyr/zmake/tests/test_modules.py
index 9446e54f1c..8fdbd3cb43 100644
--- a/zephyr/zmake/tests/test_modules.py
+++ b/zephyr/zmake/tests/test_modules.py
@@ -7,8 +7,8 @@
import pathlib
import tempfile
-import hypothesis
-import hypothesis.strategies as st
+import hypothesis # pylint:disable=import-error
+import hypothesis.strategies as st # pylint:disable=import-error
import zmake.modules
module_lists = st.lists(
diff --git a/zephyr/zmake/tests/test_packers.py b/zephyr/zmake/tests/test_packers.py
index 402cee690e..a038b51abd 100644
--- a/zephyr/zmake/tests/test_packers.py
+++ b/zephyr/zmake/tests/test_packers.py
@@ -7,9 +7,9 @@
import pathlib
import tempfile
-import hypothesis
-import hypothesis.strategies as st
-import pytest
+import hypothesis # pylint:disable=import-error
+import hypothesis.strategies as st # pylint:disable=import-error
+import pytest # pylint:disable=import-error
import zmake.output_packers as packers
# Strategies for use with hypothesis
diff --git a/zephyr/zmake/tests/test_project.py b/zephyr/zmake/tests/test_project.py
index 5b5ca12583..2d98aaf32b 100644
--- a/zephyr/zmake/tests/test_project.py
+++ b/zephyr/zmake/tests/test_project.py
@@ -8,9 +8,9 @@ import pathlib
import string
import tempfile
-import hypothesis
-import hypothesis.strategies as st
-import pytest
+import hypothesis # pylint:disable=import-error
+import hypothesis.strategies as st # pylint:disable=import-error
+import pytest # pylint:disable=import-error
import zmake.modules
import zmake.output_packers
import zmake.project
diff --git a/zephyr/zmake/tests/test_reexec.py b/zephyr/zmake/tests/test_reexec.py
index 08943909b2..d36b873506 100644
--- a/zephyr/zmake/tests/test_reexec.py
+++ b/zephyr/zmake/tests/test_reexec.py
@@ -7,7 +7,7 @@ import os
import sys
import unittest.mock as mock
-import pytest
+import pytest # pylint:disable=import-error
import zmake.__main__ as main
diff --git a/zephyr/zmake/tests/test_toolchains.py b/zephyr/zmake/tests/test_toolchains.py
index f210bb7511..3773fac13d 100644
--- a/zephyr/zmake/tests/test_toolchains.py
+++ b/zephyr/zmake/tests/test_toolchains.py
@@ -7,7 +7,7 @@
import os
import pathlib
-import pytest
+import pytest # pylint:disable=import-error
import zmake.output_packers
import zmake.project as project
import zmake.toolchains as toolchains
diff --git a/zephyr/zmake/tests/test_util.py b/zephyr/zmake/tests/test_util.py
index 4a6c39f904..824e38d045 100644
--- a/zephyr/zmake/tests/test_util.py
+++ b/zephyr/zmake/tests/test_util.py
@@ -7,9 +7,9 @@
import pathlib
import tempfile
-import hypothesis
-import hypothesis.strategies as st
-import pytest
+import hypothesis # pylint:disable=import-error
+import hypothesis.strategies as st # pylint:disable=import-error
+import pytest # pylint:disable=import-error
import zmake.util as util
# Strategies for use with hypothesis
diff --git a/zephyr/zmake/tests/test_zmake.py b/zephyr/zmake/tests/test_zmake.py
index 1c892ca2e4..db7189a2e8 100644
--- a/zephyr/zmake/tests/test_zmake.py
+++ b/zephyr/zmake/tests/test_zmake.py
@@ -10,14 +10,14 @@ import pathlib
import re
import unittest.mock
-import pytest
+import pytest # pylint:disable=import-error
import zmake.build_config
import zmake.jobserver
import zmake.multiproc as multiproc
import zmake.output_packers
import zmake.project
import zmake.toolchains
-from testfixtures import LogCapture
+from testfixtures import LogCapture # pylint:disable=import-error
OUR_PATH = os.path.dirname(os.path.realpath(__file__))