fix: fail make check on shellcheck findings
This commit is contained in:
1 parent
b75c2868fe
commit
bccd1f5510
4 files changed
+10
-4
No files matched your search
@@ -119,13 +119,15 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Syntax-check every shell file, and run shellcheck when it is available.
|
# Syntax-check every shell file, and run shellcheck when it is available.
|
||||||
|
# SC2034 is off: the files share their variables, and shellcheck looks at one
|
||||||
|
# file at a time.
|
||||||
check:
|
check:
|
||||||
@set -e; for f in src/face-unlock $(LIBS) tests/*.sh; do \
|
@set -e; for f in src/face-unlock $(LIBS) tests/*.sh; do \
|
||||||
bash -n "$$f" && echo "ok $$f"; \
|
bash -n "$$f" && echo "ok $$f"; \
|
||||||
done
|
done
|
||||||
@if command -v shellcheck >/dev/null 2>&1; then \
|
@if command -v shellcheck >/dev/null 2>&1; then \
|
||||||
shellcheck -x -e SC1090,SC1091 src/face-unlock $(LIBS) tests/*.sh; \
|
shellcheck -x -e SC1090,SC1091,SC2034 src/face-unlock $(LIBS) tests/*.sh \
|
||||||
echo "ok shellcheck"; \
|
&& echo "ok shellcheck"; \
|
||||||
else \
|
else \
|
||||||
echo "shellcheck not found, skipped"; \
|
echo "shellcheck not found, skipped"; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ fu_kv_set() {
|
|||||||
{
|
{
|
||||||
printf '# %s\n' "$header"
|
printf '# %s\n' "$header"
|
||||||
printf '#\n'
|
printf '#\n'
|
||||||
|
# shellcheck disable=SC2016 # the backticks are text
|
||||||
printf '# Written by `%s`. Nothing here needs editing by hand:\n' "$FU_NAME"
|
printf '# Written by `%s`. Nothing here needs editing by hand:\n' "$FU_NAME"
|
||||||
printf '# every option is in the menu.\n'
|
printf '# every option is in the menu.\n'
|
||||||
} > "$file" || return 1
|
} > "$file" || return 1
|
||||||
|
|||||||
+2
-2
@@ -421,11 +421,11 @@ _fu_camera_label() {
|
|||||||
|
|
||||||
# _fu_setting_change <scope> <Key> <type> <current> <choices> <step>
|
# _fu_setting_change <scope> <Key> <type> <current> <choices> <step>
|
||||||
_fu_setting_change() {
|
_fu_setting_change() {
|
||||||
local scope="$1" key="$2" type="$3" current="$4" choices="$5" step="$6" next
|
local scope="$1" key="$2" type="$3" current="$4" options="$5" step="$6" next
|
||||||
|
|
||||||
case "$type" in
|
case "$type" in
|
||||||
bool) if fu_is_true "$current"; then next=no; else next=yes; fi ;;
|
bool) if fu_is_true "$current"; then next=no; else next=yes; fi ;;
|
||||||
choice) next="$(_fu_next_choice "$current" "$choices" "$step")" ;;
|
choice) next="$(_fu_next_choice "$current" "$options" "$step")" ;;
|
||||||
camera) next="$(_fu_next_camera "$current" "$step")" ;;
|
camera) next="$(_fu_next_camera "$current" "$step")" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
# also run through real PAM, with the module missing on purpose: the dash in
|
# also run through real PAM, with the module missing on purpose: the dash in
|
||||||
# front of the line has to make PAM skip it without a word.
|
# front of the line has to make PAM skip it without a word.
|
||||||
|
|
||||||
|
# check() runs its second argument with eval, so that is quoted on purpose.
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
|
|
||||||
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
|||||||
Reference in new issue
Block a user