diff options
author | Robert Hensing | 2024-07-28 13:31:10 +0200 |
---|---|---|
committer | GitHub | 2024-07-28 13:31:10 +0200 |
commit | 4ca52fdf5f0da995fc26e7d07c6c30a710ed4f8a (patch) | |
tree | 981413fa1c72cdddec335f603029207e4e1bf62d /doc | |
parent | cabb09a2895400362c92e6a54e629269eb12276d (diff) | |
parent | 2d9a6864833e3cca4b05aa6bd4ef88c8813989ca (diff) |
Merge pull request #323613 from CyberShadow/fix-nix-path-without-channels-v2
nix-channel: do not set empty nix-path when disabling channels
Diffstat (limited to 'doc')
-rw-r--r-- | doc/build-helpers/testers.chapter.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/build-helpers/testers.chapter.md b/doc/build-helpers/testers.chapter.md index a10e60de8c6d..ec659e75bdb5 100644 --- a/doc/build-helpers/testers.chapter.md +++ b/doc/build-helpers/testers.chapter.md @@ -116,6 +116,55 @@ It has two modes: : The `lychee` package to use. +## `shellcheck` {#tester-shellcheck} + +Runs files through `shellcheck`, a static analysis tool for shell scripts. + +:::{.example #ex-shellcheck} +# Run `testers.shellcheck` + +A single script + +```nix +testers.shellcheck { + name = "shellcheck"; + src = ./script.sh; +} +``` + +Multiple files + +```nix +let + inherit (lib) fileset; +in +testers.shellcheck { + name = "shellcheck"; + src = fileset.toSource { + root = ./.; + fileset = fileset.unions [ + ./lib.sh + ./nixbsd-activate + ]; + }; +} +``` + +::: + +### Inputs {#tester-shellcheck-inputs} + +[`src` (path or string)]{#tester-shellcheck-param-src} + +: The path to the shell script(s) to check. + This can be a single file or a directory containing shell files. + All files in `src` will be checked, so you may want to provide `fileset`-based source instead of a whole directory. + +### Return value {#tester-shellcheck-return} + +A derivation that runs `shellcheck` on the given script(s). +The build will fail if `shellcheck` finds any issues. + ## `testVersion` {#tester-testVersion} Checks that the output from running a command contains the specified version string in it as a whole word. |