···311311 Similar to writeShellScriptBin and writeScriptBin.
312312 Writes an executable Shell script to /nix/store/<store path>/bin/<name> and
313313 checks its syntax with shellcheck and the shell's -n option.
314314+ Individual checks can be foregone by putting them in the excludeShellChecks
315315+ list, e.g. [ "SC2016" ].
314316 Automatically includes sane set of shellopts (errexit, nounset, pipefail)
315317 and handles creation of PATH based on runtimeInputs
316318···338340 , runtimeInputs ? [ ]
339341 , meta ? { }
340342 , checkPhase ? null
343343+ , excludeShellChecks ? [ ]
341344 }:
342345 writeTextFile {
343346 inherit name meta;
···363366 # but we still want to use writeShellApplication on those platforms
364367 let
365368 shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck.compiler;
369369+ excludeOption = lib.optionalString (excludeShellChecks != [ ]) "--exclude '${lib.concatStringsSep "," excludeShellChecks}'";
366370 shellcheckCommand = lib.optionalString shellcheckSupported ''
367371 # use shellcheck which does not include docs
368372 # pandoc takes long to build and documentation isn't needed for just running the cli
369369- ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} "$target"
373373+ ${lib.getExe (haskell.lib.compose.justStaticExecutables shellcheck.unwrapped)} ${excludeOption} "$target"
370374 '';
371375 in
372376 if checkPhase == null then ''