writeShellApplication: add argument extraShellCheckFlags
This commit is contained in:
parent
e80d1b6300
commit
751e9b6c7f
|
@ -233,6 +233,12 @@ rec {
|
||||||
Type: [String]
|
Type: [String]
|
||||||
*/
|
*/
|
||||||
excludeShellChecks ? [ ],
|
excludeShellChecks ? [ ],
|
||||||
|
/*
|
||||||
|
Extra command-line flags to pass to ShellCheck.
|
||||||
|
|
||||||
|
Type: [String]
|
||||||
|
*/
|
||||||
|
extraShellCheckFlags ? [ ],
|
||||||
/*
|
/*
|
||||||
Bash options to activate with `set -o` at the start of the script.
|
Bash options to activate with `set -o` at the start of the script.
|
||||||
|
|
||||||
|
@ -282,11 +288,11 @@ rec {
|
||||||
# but we still want to use writeShellApplication on those platforms
|
# but we still want to use writeShellApplication on those platforms
|
||||||
let
|
let
|
||||||
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler;
|
shellcheckSupported = lib.meta.availableOn stdenv.buildPlatform shellcheck-minimal.compiler;
|
||||||
excludeOption = lib.optionalString (excludeShellChecks != [ ]) "--exclude '${lib.concatStringsSep "," excludeShellChecks}'";
|
excludeFlags = lib.optionals (excludeShellChecks != [ ]) [ "--exclude" (lib.concatStringsSep "," excludeShellChecks) ];
|
||||||
shellcheckCommand = lib.optionalString shellcheckSupported ''
|
shellcheckCommand = lib.optionalString shellcheckSupported ''
|
||||||
# use shellcheck which does not include docs
|
# use shellcheck which does not include docs
|
||||||
# pandoc takes long to build and documentation isn't needed for just running the cli
|
# pandoc takes long to build and documentation isn't needed for just running the cli
|
||||||
${lib.getExe shellcheck-minimal} ${excludeOption} "$target"
|
${lib.getExe shellcheck-minimal} ${lib.escapeShellArgs (excludeFlags ++ extraShellCheckFlags)} "$target"
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
if checkPhase == null then ''
|
if checkPhase == null then ''
|
||||||
|
|
Loading…
Reference in New Issue
Block a user