Re: [RFC kvm-unit-tests PATCH v2 01/14] Add initial shellcheck checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 06/04/2024 14.38, Nicholas Piggin wrote:
This adds a basic shellcheck sytle file, some directives to help


find scripts, and a make shellcheck target.

When changes settle down this could be made part of the standard
build / CI flow.

Suggested-by: Andrew Jones <andrew.jones@xxxxxxxxx>
Reviewed-by: Andrew Jones <andrew.jones@xxxxxxxxx>
Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
diff --git a/ b/
index 6e82dc225..03ff5994e 100644
--- a/
+++ b/
@@ -193,3 +193,6 @@ with `git config diff.orderFile scripts/git.difforder` enables it.
We strive to follow the Linux kernels coding style so it's recommended
  to run the kernel's ./scripts/ on new patches.
+Also run make shellcheck before submitting a patch which touches bash

I'd maybe put "make shellcheck" in quotes to make the sentence more readable?

diff --git a/scripts/common.bash b/scripts/common.bash
index ee1dd8659..3aa557c8c 100644
--- a/scripts/common.bash
+++ b/scripts/common.bash
@@ -82,8 +82,11 @@ function arch_cmd()
# The current file has to be the only file sourcing the arch helper
-# file
+# file. Shellcheck can't follow this so help it out. There doesn't appear to be a
+# way to specify multiple alternatives, so we will have to rethink this if things
+# get more complicated.
  if [ -f "${ARCH_FUNC}" ]; then
+# shellcheck source=scripts/s390x/func.bash
  	source "${ARCH_FUNC}"


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux