summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2023-02-03 13:33:43 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-03 22:37:08 +0000
commitbb1bf345d928a602916bed6eefef4a317a577849 (patch)
tree35fc57378a9472c84a9450284090d7cb3d37f970 /util
parent989f9d24a097a8da7de10c5f765f3718597ac73c (diff)
downloadchrome-ec-bb1bf345d928a602916bed6eefef4a317a577849.tar.gz
ec: Use chromite isort config
Remove the .isort.cfg from platform/ec and use the one from chromite instead. This should be compatible with cros format. BRANCH=None BUG=b:267757300 TEST=Ran firmware_builder.py Change-Id: Ice4955b6995bd1f9380e97f58e89efb7c1e8aeb1 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4221928 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/build_with_clang.py3
-rwxr-xr-xutil/check_zephyr_project_config.py2
-rwxr-xr-xutil/check_zephyr_project_config_unittest.py1
-rwxr-xr-xutil/clangd_config.py2
-rwxr-xr-xutil/crash_analyzer.py1
-rwxr-xr-xutil/ec3po/console.py6
-rwxr-xr-xutil/ec3po/console_unittest.py5
-rw-r--r--util/ec3po/interpreter.py1
-rwxr-xr-xutil/ec3po/interpreter_unittest.py3
-rw-r--r--util/ec3po/threadproc_shim.py1
-rwxr-xr-xutil/ec_openocd.py1
-rwxr-xr-xutil/flash_jlink.py1
-rwxr-xr-xutil/inject-keys.py1
-rwxr-xr-xutil/kconfig_check.py1
-rwxr-xr-xutil/lcov_stencil.py3
-rw-r--r--util/run_ects.py1
-rw-r--r--util/test_kconfig_check.py1
-rwxr-xr-xutil/twister_launcher.py4
-rwxr-xr-xutil/twister_tags.py1
-rwxr-xr-xutil/uart_stress_tester.py5
-rwxr-xr-xutil/update_release_branch.py1
21 files changed, 35 insertions, 10 deletions
diff --git a/util/build_with_clang.py b/util/build_with_clang.py
index 79ba1072fd..bf1f452008 100755
--- a/util/build_with_clang.py
+++ b/util/build_with_clang.py
@@ -7,6 +7,7 @@
"""Build firmware with clang instead of gcc."""
import argparse
import concurrent
+from concurrent.futures import ThreadPoolExecutor
import logging
import multiprocessing
import os
@@ -14,7 +15,7 @@ import shutil
import subprocess
import sys
import typing
-from concurrent.futures import ThreadPoolExecutor
+
# Add to this list as compilation errors are fixed for boards.
BOARDS_THAT_COMPILE_SUCCESSFULLY_WITH_CLANG = [
diff --git a/util/check_zephyr_project_config.py b/util/check_zephyr_project_config.py
index be90e8092f..d879a9f04e 100755
--- a/util/check_zephyr_project_config.py
+++ b/util/check_zephyr_project_config.py
@@ -14,6 +14,7 @@ import site
import sys
import tempfile
+
EC_BASE = pathlib.Path(__file__).parent.parent
if "ZEPHYR_BASE" in os.environ:
@@ -35,6 +36,7 @@ site.addsitedir(ZEPHYR_BASE / "scripts" / "kconfig")
import kconfiglib
import zephyr_module
+
# pylint:enable=import-error,wrong-import-position
# Known configuration file extensions.
diff --git a/util/check_zephyr_project_config_unittest.py b/util/check_zephyr_project_config_unittest.py
index ad28d8e128..d881cc5a91 100755
--- a/util/check_zephyr_project_config_unittest.py
+++ b/util/check_zephyr_project_config_unittest.py
@@ -13,6 +13,7 @@ import unittest
import check_zephyr_project_config
import mock # pylint:disable=import-error
+
# pylint:disable=protected-access
diff --git a/util/clangd_config.py b/util/clangd_config.py
index 1e013b4159..e9b23e3a04 100755
--- a/util/clangd_config.py
+++ b/util/clangd_config.py
@@ -10,10 +10,10 @@ import argparse
import glob
import multiprocessing
import os
+from pathlib import Path
import shutil
import subprocess
import sys
-from pathlib import Path
from typing import List, Optional
diff --git a/util/crash_analyzer.py b/util/crash_analyzer.py
index 88592f800a..d564984500 100755
--- a/util/crash_analyzer.py
+++ b/util/crash_analyzer.py
@@ -10,6 +10,7 @@ import pathlib
import re
import sys
+
# TODO(b/253492108): Add regexp for missing architectures.
# Regex tested here: https://regex101.com/r/K5S8cB/1
_REGEX_CORTEX_M0 = (
diff --git a/util/ec3po/console.py b/util/ec3po/console.py
index 12b31baa60..cc822a7073 100755
--- a/util/ec3po/console.py
+++ b/util/ec3po/console.py
@@ -17,6 +17,7 @@ from __future__ import print_function
import argparse
import binascii
import ctypes
+from datetime import datetime
import logging
import os
import pty
@@ -25,10 +26,11 @@ import select
import stat
import sys
import traceback
-from datetime import datetime
+from ec3po import interpreter
+from ec3po import threadproc_shim
import six
-from ec3po import interpreter, threadproc_shim
+
PROMPT = b"> "
CONSOLE_INPUT_LINE_SIZE = 80 # Taken from the CONFIG_* with the same name.
diff --git a/util/ec3po/console_unittest.py b/util/ec3po/console_unittest.py
index e2a3d588fd..dfa411f3c8 100755
--- a/util/ec3po/console_unittest.py
+++ b/util/ec3po/console_unittest.py
@@ -14,9 +14,12 @@ import logging
import tempfile
import unittest
+from ec3po import console
+from ec3po import interpreter
+from ec3po import threadproc_shim
import mock # pylint:disable=import-error
import six
-from ec3po import console, interpreter, threadproc_shim
+
ESC_STRING = six.int2byte(console.ControlKey.ESC)
diff --git a/util/ec3po/interpreter.py b/util/ec3po/interpreter.py
index 8d21af247a..16c047039b 100644
--- a/util/ec3po/interpreter.py
+++ b/util/ec3po/interpreter.py
@@ -25,6 +25,7 @@ import traceback
import six
+
COMMAND_RETRIES = 3 # Number of attempts to retry a command.
EC_MAX_READ = 1024 # Max bytes to read at a time from the EC.
EC_SYN = b"\xec" # Byte indicating EC interrogation.
diff --git a/util/ec3po/interpreter_unittest.py b/util/ec3po/interpreter_unittest.py
index e8f19e2e46..a6bfd3baec 100755
--- a/util/ec3po/interpreter_unittest.py
+++ b/util/ec3po/interpreter_unittest.py
@@ -13,9 +13,10 @@ import logging
import tempfile
import unittest
+from ec3po import interpreter
+from ec3po import threadproc_shim
import mock # pylint:disable=import-error
import six
-from ec3po import interpreter, threadproc_shim
def GetBuiltins(func):
diff --git a/util/ec3po/threadproc_shim.py b/util/ec3po/threadproc_shim.py
index f76841dbf7..b468de1535 100644
--- a/util/ec3po/threadproc_shim.py
+++ b/util/ec3po/threadproc_shim.py
@@ -38,6 +38,7 @@ from threading import Thread as ThreadOrProcess
from six.moves.queue import Queue
+
# True if this module has ec3po using subprocesses, False if using threads.
USING_SUBPROCS = False
diff --git a/util/ec_openocd.py b/util/ec_openocd.py
index e0a15bd08b..4d114d4343 100755
--- a/util/ec_openocd.py
+++ b/util/ec_openocd.py
@@ -12,6 +12,7 @@ import subprocess
import sys
import time
+
"""
Flashes and debugs the EC through openocd
"""
diff --git a/util/flash_jlink.py b/util/flash_jlink.py
index dc462e354b..9f4a55e544 100755
--- a/util/flash_jlink.py
+++ b/util/flash_jlink.py
@@ -25,6 +25,7 @@ import sys
import tempfile
import time
+
DEFAULT_SEGGER_REMOTE_PORT = 19020
# Commands are documented here: https://wiki.segger.com/J-Link_Commander
diff --git a/util/inject-keys.py b/util/inject-keys.py
index 7ff72ea134..71eb7a3281 100755
--- a/util/inject-keys.py
+++ b/util/inject-keys.py
@@ -13,6 +13,7 @@ import string
import subprocess
import sys
+
KEYMATRIX = {
"`": (3, 1),
"1": (6, 1),
diff --git a/util/kconfig_check.py b/util/kconfig_check.py
index f3d127175c..1b67f0c846 100755
--- a/util/kconfig_check.py
+++ b/util/kconfig_check.py
@@ -27,6 +27,7 @@ import re
import sys
import traceback
+
# Try to use kconfiglib if available, but fall back to a simple recursive grep.
# This is used by U-Boot in some situations so we keep it to avoid forking this
# script.
diff --git a/util/lcov_stencil.py b/util/lcov_stencil.py
index 12d613c6a4..ba08f0ccaa 100755
--- a/util/lcov_stencil.py
+++ b/util/lcov_stencil.py
@@ -13,12 +13,13 @@ https://github.com/linux-test-project/lcov/blob/master/bin/geninfo
"""
import argparse
+from collections import defaultdict
import logging
import re
import sys
-from collections import defaultdict
from typing import Dict, Set
+
EXTRACT_LINE = re.compile(r"^(FN|DA|BRDA):(\d+),")
EXTRACT_FN = re.compile(r"^(FN):(\d+),(\S+)")
EXTRACT_FNDA = re.compile(r"^(FNDA):(\d+),(\S+)")
diff --git a/util/run_ects.py b/util/run_ects.py
index a3bf4d295c..e9ab944938 100644
--- a/util/run_ects.py
+++ b/util/run_ects.py
@@ -11,6 +11,7 @@ import os
import subprocess
import sys
+
# List of tests to run.
TESTS = ["meta", "gpio", "hook", "i2c", "interrupt", "mutex", "task", "timer"]
diff --git a/util/test_kconfig_check.py b/util/test_kconfig_check.py
index 3e459006b1..e30df416fb 100644
--- a/util/test_kconfig_check.py
+++ b/util/test_kconfig_check.py
@@ -14,6 +14,7 @@ import unittest
import kconfig_check
+
# Prefix that we strip from each Kconfig option, when considering whether it is
# equivalent to a CONFIG option with the same name
PREFIX = "PLATFORM_EC_"
diff --git a/util/twister_launcher.py b/util/twister_launcher.py
index 2d6fe9616a..9178b142d9 100755
--- a/util/twister_launcher.py
+++ b/util/twister_launcher.py
@@ -82,16 +82,16 @@ import argparse
import json
import os
import pathlib
+from pathlib import Path
import re
import shlex
import shutil
+from shutil import which
import socket
import subprocess
import sys
import tempfile
import time
-from pathlib import Path
-from shutil import which
def find_checkout() -> Path:
diff --git a/util/twister_tags.py b/util/twister_tags.py
index 68ac5846bd..851c526bac 100755
--- a/util/twister_tags.py
+++ b/util/twister_tags.py
@@ -24,6 +24,7 @@ import sys
import yaml # pylint: disable=import-error
+
TAG_TO_DESCRIPTION = {
"common": "Directly test shared code in the ec/common dir",
"mkbp": "Testing the MKBP (Matrix Keyboard Protocol) stack",
diff --git a/util/uart_stress_tester.py b/util/uart_stress_tester.py
index 8abb71d144..2e96174930 100755
--- a/util/uart_stress_tester.py
+++ b/util/uart_stress_tester.py
@@ -17,7 +17,9 @@ Prerequisite:
e.g. dut-control cr50_uart_timestamp:off
"""
-from __future__ import absolute_import, division, print_function
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
import argparse
import atexit
@@ -30,6 +32,7 @@ import time
import serial # pylint:disable=import-error
+
BAUDRATE = 115200 # Default baudrate setting for UART port
CROS_USERNAME = "root" # Account name to login to ChromeOS
CROS_PASSWORD = "test0000" # Password to login to ChromeOS
diff --git a/util/update_release_branch.py b/util/update_release_branch.py
index 939d572dc4..93527c312c 100755
--- a/util/update_release_branch.py
+++ b/util/update_release_branch.py
@@ -19,6 +19,7 @@ import subprocess
import sys
import textwrap
+
BUG_NONE_PATTERN = re.compile("none", flags=re.IGNORECASE)