Skip to content

Commit

Permalink
style: shellcheck all .sh files
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Dec 31, 2018
1 parent 3bb50d2 commit 3cc048f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 22 deletions.
14 changes: 8 additions & 6 deletions .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
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile_current_arch
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions gui.sh
@@ -1,3 +1,3 @@
#!/bin/sh
cd $(dirname $0)
exec python3 -m oomox_gui $@
cd "$(dirname "$0")" &&
exec python3 -m oomox_gui "$@"
4 changes: 2 additions & 2 deletions maintenance_scripts/changelog.sh
Expand Up @@ -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
12 changes: 10 additions & 2 deletions maintenance_scripts/run_ci.sh
Expand Up @@ -2,7 +2,7 @@
set -ueo pipefail

Xvfb :99 -ac -screen 0 1920x1080x16 -nolisten tcp &
xvfb_pid=$!
xvfb_pid="$!"

clean_up() {
kill ${xvfb_pid}
Expand All @@ -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
6 changes: 3 additions & 3 deletions 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
Expand All @@ -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
11 changes: 6 additions & 5 deletions 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
2 changes: 1 addition & 1 deletion packaging/flatpak/flatpak-builder-build.sh
Expand Up @@ -2,4 +2,4 @@
#--skip-if-unchanged \
flatpak-builder \
app-dir com.github.themix_project.Oomox.json \
$@
"$@"

0 comments on commit 3cc048f

Please sign in to comment.