Fix linters issues and enable tox/zuul linters job as gate
Fix below issues: E003 Indent not multiple of 4 E011 Then keyword is not on same line as if or elif keyword E020: Function declaration not in format "^function name {$": 'function check_all_explicit_deps_installed' add ignore in tox env E006 Line too long E010: Do not on same line as command Change-Id: I13fb83452324c0db74c485f304827a6c9aacf9ae Story: 2003370 Task: 24431 Signed-off-by: Sun Austin <austin.sun@intel.com>
This commit is contained in:
parent
58b942baf1
commit
7c748292c4
@ -1,5 +1,7 @@
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- openstack-tox-linters:
|
||||
voting: false
|
||||
- openstack-tox-linters
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-linters
|
||||
|
@ -50,8 +50,7 @@ for subgit in $SUBGITS; do
|
||||
# check if destination branch already exists
|
||||
echo "$subgit"
|
||||
branch_check=`git branch -a --list $NEW_BRANCH`
|
||||
if [ -z "$branch_check" ]
|
||||
then
|
||||
if [ -z "$branch_check" ]; then
|
||||
echo "Creating $NEW_BRANCH"
|
||||
git checkout $OLD_BRANCH
|
||||
git checkout -b $NEW_BRANCH
|
||||
@ -60,8 +59,7 @@ for subgit in $SUBGITS; do
|
||||
echo "$NEW_BRANCH already exists"
|
||||
fi
|
||||
tag_check=`git tag -l $NEW_TAG`
|
||||
if [ -z "$tag_check" ]
|
||||
then
|
||||
if [ -z "$tag_check" ]; then
|
||||
echo "Creating $NEW_TAG"
|
||||
# create tag
|
||||
git checkout $NEW_BRANCH
|
||||
@ -76,11 +74,3 @@ for subgit in $SUBGITS; do
|
||||
done
|
||||
|
||||
echo "All done. branches and tags are pushed"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -21,8 +21,7 @@ for subgit in $SUBGITS; do
|
||||
# check if destination branch already exists
|
||||
echo "$subgit"
|
||||
branch_check=`git branch -a --list $branch`
|
||||
if [ -z "$branch_check" ]
|
||||
then
|
||||
if [ -z "$branch_check" ]; then
|
||||
echo "Creating branch $branch"
|
||||
git checkout -b $branch
|
||||
if [ $? != 0 ] ; then
|
||||
@ -37,8 +36,7 @@ for subgit in $SUBGITS; do
|
||||
fi
|
||||
|
||||
tag_check=`git tag -l $tag`
|
||||
if [ -z "$tag_check" ]
|
||||
then
|
||||
if [ -z "$tag_check" ]; then
|
||||
echo "Creating tag $tag"
|
||||
git tag $tag
|
||||
if [ $? != 0 ] ; then
|
||||
|
@ -17,8 +17,7 @@ for subgit in $SUBGITS; do
|
||||
pushd $subgit > /dev/null
|
||||
|
||||
tag_check=`git tag -l $tag`
|
||||
if [ -z "$tag_check" ]
|
||||
then
|
||||
if [ -z "$tag_check" ]; then
|
||||
echo "Creating tag $tag"
|
||||
git tag $tag
|
||||
if [ $? != 0 ] ; then
|
||||
|
@ -72,8 +72,7 @@ function install_deps {
|
||||
|
||||
echo "Debug: List of deps to resolve: ${DEP_LIST}"
|
||||
|
||||
if [ -z "${DEP_LIST}" ]
|
||||
then
|
||||
if [ -z "${DEP_LIST}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -155,8 +154,7 @@ function install_deps {
|
||||
|
||||
>&2 echo "Installing PKG=$PKG PKG_FILE=$PKG_FILE PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH from repo $REPOID"
|
||||
cp $PKG_PATH .
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
if [ $? -ne 0 ]; then
|
||||
>&2 echo " Here's what I have to work with..."
|
||||
>&2 echo " TMPDIR=$TMP_DIR repoquery -c $YUM --repoid=$REPOID --arch=x86_64,noarch --resolve $PKG --qf=\"%{name} %{name}-%{version}-%{release}.%{arch}.rpm %{relativepath}\""
|
||||
>&2 echo " PKG=$PKG PKG_FILE=$PKG_FILE REPO_PATH=$REPO_PATH PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH"
|
||||
@ -184,8 +182,7 @@ function install_deps {
|
||||
>&2 echo ""
|
||||
}
|
||||
|
||||
function check_all_explicit_deps_installed
|
||||
{
|
||||
function check_all_explicit_deps_installed {
|
||||
|
||||
PKGS_TO_CHECK=" "
|
||||
while read PKG_TO_ADD
|
||||
@ -205,8 +202,7 @@ function check_all_explicit_deps_installed
|
||||
fi
|
||||
done < $TMPFILE
|
||||
|
||||
if [ -z "$PKGS_TO_CHECK" ]
|
||||
then
|
||||
if [ -z "$PKGS_TO_CHECK" ]; then
|
||||
>&2 echo "All explicitly specified packages resolved!"
|
||||
else
|
||||
>&2 echo "Could not resolve packages: $PKGS_TO_CHECK"
|
||||
|
@ -25,8 +25,7 @@ function install_deps {
|
||||
|
||||
echo "Debug: List of deps to resolve: ${DEP_LIST}"
|
||||
|
||||
if [ -z "${DEP_LIST}" ]
|
||||
then
|
||||
if [ -z "${DEP_LIST}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@ -74,8 +73,7 @@ function install_deps {
|
||||
|
||||
>&2 echo "Installing PKG=$PKG PKG_FILE=$PKG_FILE PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH from repo $REPOID"
|
||||
cp $PKG_PATH .
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
if [ $? -ne 0 ]; then
|
||||
>&2 echo " Here's what I have to work with..."
|
||||
>&2 echo " TMPDIR=$TMP_DIR repoquery -c $YUM --repoid=$REPOID --arch=x86_64,noarch --resolve $PKG --qf=\"%{name} %{name}-%{version}-%{release}.%{arch}.rpm %{relativepath}\""
|
||||
>&2 echo " PKG=$PKG PKG_FILE=$PKG_FILE REPO_PATH=$REPO_PATH PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH"
|
||||
@ -104,8 +102,7 @@ function install_deps {
|
||||
>&2 echo ""
|
||||
}
|
||||
|
||||
function check_all_explicit_deps_installed
|
||||
{
|
||||
function check_all_explicit_deps_installed {
|
||||
|
||||
PKGS_TO_CHECK=" "
|
||||
while read PKG_TO_ADD
|
||||
@ -127,8 +124,7 @@ function check_all_explicit_deps_installed
|
||||
fi
|
||||
done < $TMPFILE
|
||||
|
||||
if [ -z "$PKGS_TO_CHECK" ]
|
||||
then
|
||||
if [ -z "$PKGS_TO_CHECK" ]; then
|
||||
>&2 echo "All explicitly specified packages resolved!"
|
||||
else
|
||||
>&2 echo "Could not resolve packages: $PKGS_TO_CHECK"
|
||||
|
@ -27,9 +27,7 @@ export GIT_LIST=$(git_list "$(dirname "${MY_REPO}")")
|
||||
|
||||
# GIT_LIST_REL: A list of root directories for all the gits under $MY_REPO/..
|
||||
# as relative paths.
|
||||
export GIT_LIST_REL=$(for p in $GIT_LIST; do
|
||||
echo .${p#$(dirname ${MY_REPO})};
|
||||
done)
|
||||
export GIT_LIST_REL=$(for p in $GIT_LIST; do echo .${p#$(dirname ${MY_REPO})}; done)
|
||||
|
||||
|
||||
#
|
||||
|
@ -2,13 +2,13 @@
|
||||
## this script is called by "update-pxe-network-installer" and run in "sudo"
|
||||
## created by Yong Hu (yong.hu@intel.com), 05/24/2018
|
||||
|
||||
function clean_rootfs() {
|
||||
function clean_rootfs {
|
||||
rootfs_dir=$1
|
||||
echo "--> remove old files in original rootfs"
|
||||
conf="$(ls ${rootfs_dir}/etc/ld.so.conf.d/kernel-*.conf)"
|
||||
echo "conf basename = $(basename $conf)"
|
||||
old_version="tbd"
|
||||
if [ -f $conf ];then
|
||||
if [ -f $conf ]; then
|
||||
old_version="$(echo $(basename $conf) | rev | cut -d'.' -f2- | rev | cut -d'-' -f2-)"
|
||||
fi
|
||||
echo "old version is $old_version"
|
||||
@ -51,7 +51,9 @@ fi
|
||||
work_dir=$1
|
||||
mode=$2
|
||||
output_dir=$work_dir/output
|
||||
if [ ! -d $output_dir ];then mkdir -p $output_dir; fi
|
||||
if [ ! -d $output_dir ]; then
|
||||
mkdir -p $output_dir;
|
||||
fi
|
||||
|
||||
if [ "$mode" != "std" ] && [ "$mode" != "rt" ]; then
|
||||
echo "ERROR: wrong kernel mode, must be std or rt"
|
||||
@ -191,7 +193,9 @@ fi
|
||||
echo $ORIG_SQUASHFS
|
||||
mount -o loop -t squashfs $ORIG_SQUASHFS $work_dir/squashfs.mnt
|
||||
|
||||
if [ ! -d ./LiveOS ];then mkdir -p ./LiveOS ; fi
|
||||
if [ ! -d ./LiveOS ]; then
|
||||
mkdir -p ./LiveOS
|
||||
fi
|
||||
|
||||
echo "--> copy rootfs.img from original squashfs.img to LiveOS folder"
|
||||
cp -f ./squashfs.mnt/LiveOS/rootfs.img ./LiveOS/.
|
||||
|
5
tox.ini
5
tox.ini
@ -12,6 +12,9 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:linters]
|
||||
# ignore below cases
|
||||
# E006 Line too long
|
||||
# E010: Do not on same line as it commands
|
||||
whitelist_externals = bash
|
||||
commands =
|
||||
bash -c "find {toxinidir} \
|
||||
@ -20,7 +23,7 @@ commands =
|
||||
-not -name \*~ \
|
||||
-not -name \*.md \
|
||||
-name \*.sh \
|
||||
-print0 | xargs -0 bashate -v"
|
||||
-print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -i E006,E010"
|
||||
bash -c "find {toxinidir} \
|
||||
\( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \
|
||||
-o \( -name .tox -prune \) \
|
||||
|
Loading…
Reference in New Issue
Block a user