Skip to content

Commit

Permalink
Add parentheses to all functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed Feb 7, 2021
1 parent c51ba2e commit cd665de
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion industrial_ci/scripts/rerun_ci
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

function show_help {
function show_help() {
cat - <<'EOF'
Usage:
rerun_ci --list
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/src/builders/catkin_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function _append_job_opts() {
fi
}

function builder_setup {
function builder_setup() {
ici_install_pkgs_for_command catkin_make "ros-${ROS_DISTRO}-catkin"
}

function builder_run_build {
function builder_run_build() {
local extend=$1
shift
local ws=$1
Expand All @@ -38,7 +38,7 @@ function builder_run_build {
ici_exec_in_workspace "$extend" "$ws" catkin_make --make-args install "${opts[@]}" "$@"
}

function builder_run_tests {
function builder_run_tests() {
local extend=$1
shift
local ws=$1
Expand All @@ -48,7 +48,7 @@ function builder_run_tests {
ici_exec_in_workspace "$extend" "$ws" catkin_make --make-args run_tests "${opts[@]}" "$@"
}

function builder_test_results {
function builder_test_results() {
local extend=$1
shift
local ws=$1
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/src/builders/catkin_make_isolated.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ function _run_catkin_make_isolated() {
ici_exec_in_workspace "$extend" "$ws" catkin_make_isolated --build-space "$ws/build" --install-space "$ws/install" --make-args "$target" "$@"
}

function builder_setup {
function builder_setup() {
ici_install_pkgs_for_command catkin_make_isolated "ros-${ROS_DISTRO}-catkin"
}

function builder_run_build {
function builder_run_build() {
local opts=()
_append_job_opts opts PARALLEL_BUILDS 0
_run_catkin_make_isolated install "${opts[@]}" "$@"
}

function builder_run_tests {
function builder_run_tests() {
local opts=()
_append_job_opts opts PARALLEL_TESTS 1
_run_catkin_make_isolated run_tests "$1" "$2" "${opts[@]}"
}

function builder_test_results {
function builder_test_results() {
local extend=$1
shift
local ws=$1
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/src/builders/catkin_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function _append_job_opts() {
fi
}

function builder_setup {
function builder_setup() {
ici_install_pkgs_for_command catkin "${PYTHON_VERSION_NAME}-catkin-tools" "ros-$ROS_DISTRO-catkin"
}

function builder_run_build {
function builder_run_build() {
local extend=$1
shift
local ws=$1
Expand All @@ -44,7 +44,7 @@ function builder_run_build {
ici_exec_in_workspace "$extend" "$ws" catkin build "${opts[@]}" --summarize --no-status "$@"
}

function builder_run_tests {
function builder_run_tests() {
local extend=$1
shift
local ws=$1
Expand All @@ -60,7 +60,7 @@ function builder_run_tests {
ici_exec_in_workspace "$extend" "$ws" catkin build --catkin-make-args run_tests -- "${opts[@]}" --no-status
}

function builder_test_results {
function builder_test_results() {
local extend=$1
shift
local ws=$1
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/src/builders/colcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

_colcon_event_handlers=(desktop_notification- status- terminal_title-)

function builder_setup {
function builder_setup() {
ici_install_pkgs_for_command colcon python3-colcon-common-extensions
if [ "$ROS_DISTRO" = "kinetic" ] || [ "$ROS_DISTRO" = "ardent" ]; then
ici_install_pkgs_for_command pip3 python3-pip
ici_asroot pip3 install -U setuptools
fi
}

function builder_run_build {
function builder_run_build() {
local extend=$1
shift
local ws=$1
Expand All @@ -41,7 +41,7 @@ function builder_run_build {
ici_exec_in_workspace "$extend" "$ws" colcon build "${opts[@]}" "$@"
}

function builder_run_tests {
function builder_run_tests() {
local extend=$1
shift
local ws=$1
Expand All @@ -63,7 +63,7 @@ function builder_run_tests {
ici_exec_in_workspace "$extend" "$ws" colcon test "${opts[@]}"
}

function builder_test_results {
function builder_test_results() {
local extend=$1
shift
local ws=$1
Expand Down
2 changes: 1 addition & 1 deletion industrial_ci/src/isolation/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function ici_run_cmd_in_docker() {

# work-around for https://github.com/moby/moby/issues/34096
# ensures that copied files are owned by the target user
function docker_cp {
function docker_cp() {
set -o pipefail
tar --numeric-owner --owner="${3:-root}" --group="${4:-root}" -c -f - -C "$(dirname "$1")" "$(basename "$1")" | docker cp - "$2"
set +o pipefail
Expand Down
2 changes: 1 addition & 1 deletion industrial_ci/src/isolation/shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function ici_forward_variable() {
fi
}

function ici_isolate {
function ici_isolate() {
if [ "${CI:-}" != true ]; then
ici_error 'ISOLATION=shell needs CI=true'
fi
Expand Down
8 changes: 4 additions & 4 deletions industrial_ci/src/ros.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

function _ros1_defaults {
function _ros1_defaults() {
export OS_CODE_NAME=${OS_CODE_NAME:-$1}
export ROS1_DISTRO=${ROS1_DISTRO:-$ROS_DISTRO}
export BUILDER=${BUILDER:-catkin_tools}
Expand All @@ -25,7 +25,7 @@ function _ros1_defaults {
export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION:-2}
}

function _ros2_defaults {
function _ros2_defaults() {
export OS_CODE_NAME=${OS_CODE_NAME:-$1}
export ROS2_DISTRO=${ROS2_DISTRO:-$ROS_DISTRO}
export BUILDER=${BUILDER:-colcon}
Expand All @@ -34,7 +34,7 @@ function _ros2_defaults {
export ROS_PYTHON_VERSION=3
}

function _set_ros_defaults {
function _set_ros_defaults() {
case "$ROS_DISTRO" in
"indigo" | "jade")
_ros1_defaults "trusty"
Expand Down Expand Up @@ -118,7 +118,7 @@ function _get_prefix() {
fi
}

function _set_ros_package_path {
function _set_ros_package_path() {
if [ -z "${ROS_REPOSITORY_PATH}" ]; then
case "$ROS_REPO" in
"building")
Expand Down
12 changes: 6 additions & 6 deletions industrial_ci/src/tests/source_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# It is dependent on environment variables that need to be exported in advance
# (As of version 0.4.4 most of them are defined in env.sh).

function install_catkin_lint {
function install_catkin_lint() {
ici_install_pypi_pkgs_for_command catkin_lint "catkin-lint"
}

function run_clang_tidy {
function run_clang_tidy() {
local regex="$1/.*"
local -n _run_clang_tidy_warnings=$2
local -n _run_clang_tidy_errors=$3
Expand Down Expand Up @@ -74,7 +74,7 @@ EOF
fi
}

function run_clang_tidy_check {
function run_clang_tidy_check() {
local target_ws=$1
local errors=()
local warnings=()
Expand All @@ -99,7 +99,7 @@ function run_clang_tidy_check {
fi
}

function run_pylint_check {
function run_pylint_check() {
local target_ws=$1

local args=()
Expand All @@ -119,11 +119,11 @@ function run_pylint_check {
ici_run "run_pylint" ici_exec_in_workspace "$target_ws/install" "$target_ws" "pylint" "${args[@]}" "${files[@]}"
}

function prepare_source_tests {
function prepare_source_tests() {
ici_check_builder
}

function run_source_tests {
function run_source_tests() {
upstream_ws=$BASEDIR/upstream_ws
target_ws=$BASEDIR/target_ws
downstream_ws=$BASEDIR/downstream_ws
Expand Down
Loading

0 comments on commit cd665de

Please sign in to comment.