From 4debb6c49448bd1f6f78e85ffc4a113d84036d43 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 9 Feb 2023 17:36:29 +0900 Subject: [PATCH] bashate: Enable E003 rule It seems there are not many lines using 2 spaces now, and the rule can be easily enabled. Change-Id: I54ede1fb83b8a150392f9b8c498ea5fa81ef38c0 --- bin/init_container.sh | 4 ++-- devstack/plugin.sh | 14 +++++++------- s2aio.sh | 28 ++++++++++++++-------------- tox.ini | 3 +-- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/bin/init_container.sh b/bin/init_container.sh index 5ba837f9..bec8f90b 100755 --- a/bin/init_container.sh +++ b/bin/init_container.sh @@ -25,7 +25,7 @@ # $3 is assumed to be the factory debug level, e.g. DEBUG if [ $1 == "debug" ]; then - $2 + $2 else - PYTHONPATH='/usr/local/lib/storlets/python' /usr/local/libexec/storlets/storlets-daemon-factory $2 $3 $HOSTNAME + PYTHONPATH='/usr/local/lib/storlets/python' /usr/local/libexec/storlets/storlets-daemon-factory $2 $3 $HOSTNAME fi diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 55bdc1c7..1eef7136 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -158,15 +158,15 @@ function _install_docker { # containers without sudo sudo grep -q docker /etc/group if [ $? -ne 0 ]; then - sudo groupadd docker + sudo groupadd docker fi add_user_to_group $STORLETS_SWIFT_RUNTIME_USER docker if [ $STORLETS_SWIFT_RUNTIME_USER == $USER ]; then - # NOTE(takashi): We need this workaroud because we can't reload - # user-group relationship in bash scripts - DOCKER_UNIX_SOCKET=/var/run/docker.sock - sudo chown $USER:$USER $DOCKER_UNIX_SOCKET + # NOTE(takashi): We need this workaroud because we can't reload + # user-group relationship in bash scripts + DOCKER_UNIX_SOCKET=/var/run/docker.sock + sudo chown $USER:$USER $DOCKER_UNIX_SOCKET fi # Restart docker daemon @@ -177,9 +177,9 @@ function prepare_storlets_install { _install_docker if is_ubuntu; then - install_package openjdk-${STORLETS_JDK_VERSION}-jdk-headless ant + install_package openjdk-${STORLETS_JDK_VERSION}-jdk-headless ant else - die $LINENO "Unsupported distro" + die $LINENO "Unsupported distro" fi install_python3 diff --git a/s2aio.sh b/s2aio.sh index 5f4a5a79..45ffeac5 100755 --- a/s2aio.sh +++ b/s2aio.sh @@ -111,24 +111,24 @@ function uninstall_s2aio { COMMAND="$1" case $COMMAND in - "install" ) - install_s2aio - ;; + "install" ) + install_s2aio + ;; - "uninstall" ) - uninstall_s2aio - ;; + "uninstall" ) + uninstall_s2aio + ;; - "start" ) - start_s2aio - ;; + "start" ) + start_s2aio + ;; - "stop" ) - stop_s2aio - ;; + "stop" ) + stop_s2aio + ;; - * ) - usage + * ) + usage esac set +e diff --git a/tox.ini b/tox.ini index 8031e876..a3306395 100644 --- a/tox.ini +++ b/tox.ini @@ -68,14 +68,13 @@ commands = oslo_debug_helper {posargs} [testenv:bashate] # Run bashate check for all bash scripts # Ignores the following rules: -# E003: Indent not multiple of 4 (we prefer to use multiples of 2) # E006: Line longer than 79 columns commands = bash -c "grep --recursive --binary-files=without-match \ --files-with-match '^.!.*\(ba\)\?sh$' \ --exclude-dir .tox \ --exclude-dir .git \ - {toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006" + {toxinidir} | xargs bashate --error . --verbose --ignore=E006" [flake8] # E123, E125 skipped as they are invalid PEP-8.