[PATCH v2 1/2] Documentation/scripts: fix shellcheck issues
There's an open issue about teaching shellcheck to automatically
recognize nix-shell shebangs:
https://github.com/koalaman/shellcheck/issues/1210
Signed-off-by: Alyssa Ross
I didn't realise that bash's ** feature (which matches any depth of
directories) wasn't enabled by default, because it appeared to work,
just didn't find all scripts.
Signed-off-by: Alyssa Ross
On Fri, Nov 18, 2022 at 10:09:47AM +0000, Alyssa Ross wrote:
I didn't realise that bash's ** feature (which matches any depth of directories) wasn't enabled by default, because it appeared to work, just didn't find all scripts.
Signed-off-by: Alyssa Ross
Fixes: 169fdd6 ("release.nix: run shellcheck on build scripts") --- v2: exclude build directories
Thanks for fixing this.
Reviewed-by: Henri Rosten
nix/checks.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nix/checks.nix b/nix/checks.nix index 9eb261f..9ffdc0a 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -11,12 +11,14 @@ runCommand "spectrum-shellcheck" { src = lib.cleanSourceWith { filter = path: type: - type == "directory" || builtins.match ''.*[^/]\.sh'' path != null; + (builtins.baseNameOf path != "build" && type == "directory") + || builtins.match ''.*[^/]\.sh'' path != null; src = lib.cleanSource ../.; };
nativeBuildInputs = [ shellcheck ]; } '' + shopt -s globstar shellcheck $src/**/*.sh touch $out '' -- 2.35.1
This patch has been committed as e2cdde0af4cebd13ceacf4ce7ce70e689bbe9dbc,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=e2cdde0af4cebd13ceacf4ce7ce7....
This is an automated message. Send comments/questions/requests to:
Alyssa Ross
This patch has been committed as 9f3671abc5512e8d625d92957d3b2d0d4c2ae8b7,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=9f3671abc5512e8d625d92957d3b....
This is an automated message. Send comments/questions/requests to:
Alyssa Ross
participants (3)
-
Alyssa Ross
-
Alyssa Ross
-
Henri Rosten