diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..2f4b94aa --- /dev/null +++ b/scripts/lint @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +export SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +cd "${SCRIPT_DIR}" +find . -iname '*.sh' | xargs -I% dot code beautify % +dot code beautify "${SCRIPT_DIR}/navi" diff --git a/src/cheat.sh b/src/cheat.sh index 8fb0888a..f96c8ee2 100755 --- a/src/cheat.sh +++ b/src/cheat.sh @@ -32,5 +32,5 @@ cheat::from_selection() { done echoerr "No valid cheatsheet!" - exit 67 + exit 67 } diff --git a/src/main.sh b/src/main.sh index 5bbae819..eadc22ae 100644 --- a/src/main.sh +++ b/src/main.sh @@ -51,7 +51,7 @@ handler::preview() { main() { case ${entry_point:-} in - preview) handler::preview "$@" 2>/dev/null || echo "Unable to find command for '${query:-}'";; + preview) handler::preview "$@" 2>/dev/null || echo "Unable to find command for '${query:-}'" ;; *) health::fzf && handler::main "$@" ;; esac } \ No newline at end of file diff --git a/src/misc.sh b/src/misc.sh index 34157dd1..980f13b2 100644 --- a/src/misc.sh +++ b/src/misc.sh @@ -5,10 +5,10 @@ dep() { : } -command_exists () { - type "$1" &> /dev/null +command_exists() { + type "$1" &> /dev/null } -echoerr() { - echo "$@" 1>&2 +echoerr() { + echo "$@" 1>&2 } diff --git a/test/core.sh b/test/core.sh index 49265d2e..3e317e7b 100644 --- a/test/core.sh +++ b/test/core.sh @@ -12,8 +12,8 @@ test::fail() { } test::run() { - echo - echo "-> $1" - shift - eval "$*" && test::success || test::fail + echo + echo "-> $1" + shift + eval "$*" && test::success || test::fail } \ No newline at end of file