diff options
-rw-r--r-- | PRESUBMIT.cfg | 3 | ||||
-rwxr-xr-x | util/python-pre-upload.sh | 49 |
2 files changed, 2 insertions, 50 deletions
diff --git a/PRESUBMIT.cfg b/PRESUBMIT.cfg index c9d0887b23..3aabbe3bb3 100644 --- a/PRESUBMIT.cfg +++ b/PRESUBMIT.cfg @@ -1,4 +1,5 @@ [Hook Overrides] +black_check: true clang_format_check: true branch_check: true checkpatch_check: true @@ -10,6 +11,7 @@ signoff_check: true tab_check: false [Hook Overrides Options] +black_check: --include_regex=^util/chargen$ checkpatch_check: --no-tree --ignore=MSLEEP,VOLATILE,SPDX_LICENSE_TAG kerneldoc_check: --include_regex=\bec_commands\.h$ @@ -29,5 +31,4 @@ presubmit_check = util/presubmit_check.sh config_option_check = util/config_option_check.py host_command_check = util/host_command_check.sh ec_commands_h = util/linux_ec_commands_h_check.sh -python_preupload = util/python-pre-upload.sh ${PRESUBMIT_FILES} migrated_files = util/migrated_files.sh ${PRESUBMIT_FILES} diff --git a/util/python-pre-upload.sh b/util/python-pre-upload.sh deleted file mode 100755 index d560e7b6af..0000000000 --- a/util/python-pre-upload.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# Copyright 2022 The ChromiumOS Authors. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -set -e - -PYTHON_FILES=() - -for path in "$@"; do - case "${path}" in - *.py|*.pyi) - PYTHON_FILES+=("${path}") - ;; - util/chargen) - PYTHON_FILES+=("${path}") - ;; - esac -done - -if [ "${#PYTHON_FILES}" -eq 0 ]; then - # No python changes made, do nothing. - exit 0 -fi - -EXIT_STATUS=0 - -# Wraps a black/isort command and reports how to fix it. -wrap_fix_msg() { - local cmd="$1" - shift - - if ! "${cmd}" "$@"; then - cat <<EOF >&2 -Looks like the ${cmd} formatter detected that formatting changes -need applied. Fix by running this command from the platform/ec -directory and amending your changes: - - ${cmd} ${PYTHON_FILES[*]} - -EOF - EXIT_STATUS=1 - fi -} - -# black and isort are provided by repo_tools -wrap_fix_msg black --check "${PYTHON_FILES[@]}" -wrap_fix_msg isort --check "${PYTHON_FILES[@]}" - -exit "${EXIT_STATUS}" |