forked from EvergreenCrypto/docker-finance
client: dev-tools: lib_linter: refactor with lib_docker::exec
This commit is contained in:
@@ -146,7 +146,7 @@ function lib_linter::__lint_bash()
|
||||
if [ -z "${_path[*]}" ]; then
|
||||
# Do all
|
||||
for _ext in "${_exts[@]}"; do
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"find ${DOCKER_FINANCE_CLIENT_REPO}/ ${DOCKER_FINANCE_CLIENT_PLUGINS}/ -type f -name \*.${_ext} \
|
||||
| while read _file
|
||||
do echo Linting \'\${_file}\'
|
||||
@@ -159,7 +159,7 @@ function lib_linter::__lint_bash()
|
||||
local _file
|
||||
_file="$(dirs +1)/${_p}"
|
||||
lib_utils::print_normal "Linting '${_file}'"
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"$_shfmt $_file $_file && $_shellcheck $_file"
|
||||
done
|
||||
fi
|
||||
@@ -182,7 +182,7 @@ function lib_linter::__lint_cpp()
|
||||
if [ -z "${_path[*]}" ]; then
|
||||
# Do all
|
||||
for _ext in "${_exts[@]}"; do
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"find ${DOCKER_FINANCE_CLIENT_REPO}/ ${DOCKER_FINANCE_CLIENT_PLUGINS}/ -type f -name \*.${_ext} \
|
||||
| while read _file
|
||||
do echo Linting \'\${_file}\'
|
||||
@@ -195,7 +195,7 @@ function lib_linter::__lint_cpp()
|
||||
local _file
|
||||
_file="$(dirs +1)/${_p}"
|
||||
lib_utils::print_normal "Linting '${_file}'"
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"$_clang_format $_file && $_cpplint $_file && $_cppcheck $_file"
|
||||
done
|
||||
fi
|
||||
@@ -211,7 +211,7 @@ function lib_linter::__lint_php()
|
||||
|
||||
if [ -z "${_path[*]}" ]; then
|
||||
# Do all
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"php-cs-fixer -n init \
|
||||
&& $_php_cs_fixer $DOCKER_FINANCE_CLIENT_REPO && $_php_cs_fixer $DOCKER_FINANCE_CLIENT_PLUGINS \
|
||||
&& $_phpstan $DOCKER_FINANCE_CLIENT_REPO $DOCKER_FINANCE_CLIENT_PLUGINS"
|
||||
@@ -221,7 +221,7 @@ function lib_linter::__lint_php()
|
||||
local _file
|
||||
_file="$(dirs +1)/${_p}"
|
||||
lib_utils::print_normal "Linting '${_file}'"
|
||||
lib_docker::__docker_compose exec -it docker-finance /bin/bash -i -c \
|
||||
lib_docker::exec \
|
||||
"$_php_cs_fixer $_file && $_phpstan $_file"
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user