diff --git a/.travis.yml b/.travis.yml index 83d713677..ef1db3c44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,14 @@ language: python env: matrix: - - PYVER=python34_venv_arch - - PYVER=python35_ubuntu_1604 - - PYVER=python36_ubuntu_1804 - - PYVER=current_arch + - PYVER=python34_venv_arch NO_SHELLCHECK=1 + - PYVER=python35_ubuntu_1604 NO_SHELLCHECK=1 + - PYVER=python36_ubuntu_1804 NO_SHELLCHECK=1 + - PYVER=current_arch NO_SHELLCHECK=0 services: - docker -script: +install: - mv ./dockerfiles/* ./ - - docker build . -f Dockerfile_$PYVER + - docker build . -f Dockerfile_$PYVER -t oomox +script: + - docker run --entrypoint ./maintenance_scripts/run_ci.sh oomox:latest --env NO_SHELLCHECK=$NO_SHELLCHECK diff --git a/dockerfiles/Dockerfile_current_arch b/dockerfiles/Dockerfile_current_arch index 4cfbc4a6d..344fc7706 100644 --- a/dockerfiles/Dockerfile_current_arch +++ b/dockerfiles/Dockerfile_current_arch @@ -3,7 +3,7 @@ WORKDIR /opt/oomox-build/ # App and test (xvfb, pylint) deps RUN pacman -Syu --noconfirm && \ - pacman -S --needed --noconfirm gtk3 python-gobject python-pylint xorg-server-xvfb + pacman -S --needed --noconfirm gtk3 python-gobject python-pylint xorg-server-xvfb shellcheck # run test COPY . /opt/oomox-build/ diff --git a/gui.sh b/gui.sh index 8637f195d..6d312fd7a 100755 --- a/gui.sh +++ b/gui.sh @@ -1,3 +1,3 @@ #!/bin/sh -cd $(dirname $0) -exec python3 -m oomox_gui $@ +cd "$(dirname "$0")" && +exec python3 -m oomox_gui "$@" diff --git a/maintenance_scripts/changelog.sh b/maintenance_scripts/changelog.sh index 1890b69ba..c29b3f680 100755 --- a/maintenance_scripts/changelog.sh +++ b/maintenance_scripts/changelog.sh @@ -7,7 +7,7 @@ IFS=$'\n\t' for tag in $(git tag | sort -V) ; do echo -e '\n' - git tag -n --format '%(taggerdate)' $tag + git tag -n --format '%(taggerdate)' "$tag" echo '-------------------------------------------------' - git tag -n999 $tag + git tag -n999 "$tag" done diff --git a/maintenance_scripts/run_ci.sh b/maintenance_scripts/run_ci.sh index 0cf13bc9c..40c4b76ad 100755 --- a/maintenance_scripts/run_ci.sh +++ b/maintenance_scripts/run_ci.sh @@ -2,7 +2,7 @@ set -ueo pipefail Xvfb :99 -ac -screen 0 1920x1080x16 -nolisten tcp & -xvfb_pid=$! +xvfb_pid="$!" clean_up() { kill ${xvfb_pid} @@ -16,4 +16,12 @@ export DISPLAY=:99 sleep 3 echo -e "\n== Running pylint:" -pylint oomox_gui ./plugins/*/oomox_plugin.py +pylint oomox_gui ./plugins/*/oomox_plugin.py --score no && +echo ':: pylint passed ::' + +if [[ "${NO_SHELLCHECK:-}" = "1" ]] ; then + echo -e "\n!! WARNING !! skipping shellcheck" +else + echo -e "\n== Running shellcheck:" + ./maintenance_scripts/shellcheck.sh +fi diff --git a/maintenance_scripts/show_recent_history.sh b/maintenance_scripts/show_recent_history.sh index 0856f4236..2ce48af03 100755 --- a/maintenance_scripts/show_recent_history.sh +++ b/maintenance_scripts/show_recent_history.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -filter=cat +filter="cat" if [[ "${1:-}" = '-c' ]] ; then filter="grep -v -i -E -e (typing|typehint|coverage|travis|docker) -e actionless.*(chore|test|style|doc|Revert|Merge|readme)" shift @@ -10,6 +10,6 @@ git log \ --pretty=tformat:"%Cred%D%Creset %ad %Cgreen%h %Cblue%an %Creset%s" \ --date='format:%Y-%m-%d' \ --color=always \ - $(git tag | grep -v gtk | sort -V | tail -n1)~1.. \ - $@ \ + "$(git tag | grep -v gtk | sort -V | tail -n1)"~1.. \ + "$@" \ | $filter diff --git a/maintenance_scripts/show_submodule_diff.sh b/maintenance_scripts/show_submodule_diff.sh index 913ba216e..7c5556a42 100755 --- a/maintenance_scripts/show_submodule_diff.sh +++ b/maintenance_scripts/show_submodule_diff.sh @@ -1,18 +1,19 @@ #!/usr/bin/env bash set -ueo pipefail + for submodule in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') ; do - hashes=$(git diff | grep ${submodule} -A 3 | grep -e "^[+-]Subproject" | cut -d ' ' -f3 | cut -d- -f1 | paste -sd '%' -) || hashes='' - if [[ ! -z "${hashes}" ]] ; then + hashes=$(git diff | grep "${submodule}" -A 3 | grep -e "^[+-]Subproject" | cut -d ' ' -f3 | cut -d- -f1 | paste -sd '%' -) || hashes='' + if [[ -n "${hashes}" ]] ; then echo echo "SUBMODULE ${submodule}:" echo "=================================================================================" hash1=$(cut -d% -f1 <<< ${hashes}) hash2=$(cut -d% -f2 <<< ${hashes}) - if [[ ${hash1} = ${hash2} ]] ; then - git -C ${submodule}/ status + if [[ "${hash1}" = "${hash2}" ]] ; then + git -C "${submodule}"/ status else echo ${hashes} - git -C ${submodule}/ log --oneline ${hash1}..${hash2} + git -C "${submodule}"/ log --oneline "${hash1}".."${hash2}" fi fi done diff --git a/packaging/flatpak/flatpak-builder-build.sh b/packaging/flatpak/flatpak-builder-build.sh index cc98ec76f..2e0b7adbc 100755 --- a/packaging/flatpak/flatpak-builder-build.sh +++ b/packaging/flatpak/flatpak-builder-build.sh @@ -2,4 +2,4 @@ #--skip-if-unchanged \ flatpak-builder \ app-dir com.github.themix_project.Oomox.json \ - $@ + "$@"