diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index f99dc9e..85638f7 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -21,4 +21,4 @@ jobs: - name: Install shellcheck and checkbashisms run: sudo apt install shfmt shellcheck devscripts - name: Check style - run: make check-style + run: make style-check diff --git a/Makefile b/Makefile index e5ed574..0ee7a32 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,9 @@ test: clean: ${MAKE} -C tests clean -check-style: python-style-check shell-style-check +style-fix: python-style-fix shell-style-fix +style-check: python-style-check shell-style-check + PYTHON_FILES=$(wildcard *.py) @@ -22,11 +24,11 @@ SH_SCRIPTS = $(shell grep -r -l '^\#!/bin/sh' * | grep -v .git | grep -v "~" | g BASH_SCRIPTS = $(shell grep -r -l '^\#!/bin/bash' * | grep -v .git | grep -v "~" | grep -v cronic-orig) shell-style-fix: - shfmt -w -i 2 -ci -bn ${SH_SCRIPTS} ${BASH_SCRIPTS} + shfmt -w -i 2 -ci -bn -sr ${SH_SCRIPTS} ${BASH_SCRIPTS} shellcheck -x -P SCRIPTDIR --format=diff ${SH_SCRIPTS} ${BASH_SCRIPTS} | patch -p1 shell-style-check: - shfmt -d -i 2 -ci -bn ${SH_SCRIPTS} ${BASH_SCRIPTS} + shfmt -d -i 2 -ci -bn -sr ${SH_SCRIPTS} ${BASH_SCRIPTS} shellcheck -x -P SCRIPTDIR --format=gcc ${SH_SCRIPTS} ${BASH_SCRIPTS} checkbashisms -l ${SH_SCRIPTS} /dev/null diff --git a/git-find-branch b/git-find-branch index 7d4ce89..d9edcc3 100755 --- a/git-find-branch +++ b/git-find-branch @@ -10,7 +10,7 @@ REPO_URL=$1 shift for BRANCH in "$@"; do - if (git ls-remote --quiet --exit-code --heads "${REPO_URL}" "${BRANCH}" >/dev/null); then + if (git ls-remote --quiet --exit-code --heads "${REPO_URL}" "${BRANCH}" > /dev/null); then echo "${BRANCH}" exit 0 fi diff --git a/git-find-fork b/git-find-fork index 54b159d..e7f0cc5 100755 --- a/git-find-fork +++ b/git-find-fork @@ -25,7 +25,7 @@ REPONAME=$3 # export GITEXISTS="git ls-remote" export GITEXISTS="wget -q --spider" -if (${GITEXISTS} "https://github.com/${ORG}/${REPONAME}.git" >/dev/null); then +if (${GITEXISTS} "https://github.com/${ORG}/${REPONAME}.git" > /dev/null); then OWNER="${ORG}" else OWNER="${UPSTREAM_ORG}"