You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/build-helpers/testers.chapter.md
+10-5
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ It has two modes:
118
118
119
119
## `shellcheck` {#tester-shellcheck}
120
120
121
-
Runs files through `shellcheck`, a static analysis tool for shell scripts.
121
+
Run files through `shellcheck`, a static analysis tool for shell scripts, failing if there are any issues.
122
122
123
123
:::{.example #ex-shellcheck}
124
124
# Run `testers.shellcheck`
@@ -127,7 +127,7 @@ A single script
127
127
128
128
```nix
129
129
testers.shellcheck {
130
-
name = "shellcheck";
130
+
name = "script";
131
131
src = ./script.sh;
132
132
}
133
133
```
@@ -139,7 +139,7 @@ let
139
139
inherit (lib) fileset;
140
140
in
141
141
testers.shellcheck {
142
-
name = "shellcheck";
142
+
name = "nixbsd-activate";
143
143
src = fileset.toSource {
144
144
root = ./.;
145
145
fileset = fileset.unions [
@@ -154,15 +154,20 @@ testers.shellcheck {
154
154
155
155
### Inputs {#tester-shellcheck-inputs}
156
156
157
-
[`src` (path or string)]{#tester-shellcheck-param-src}
157
+
`name` (string, optional)
158
+
: The name of the test.
159
+
`name` will be required at a future point because it massively improves traceability of test failures, but is kept optional for now to avoid breaking existing usages.
160
+
Defaults to `run-shellcheck`.
161
+
The name of the derivation produced by the tester is `shellcheck-${name}` when `name` is supplied.
158
162
163
+
`src` (path-like)
159
164
: The path to the shell script(s) to check.
160
165
This can be a single file or a directory containing shell files.
161
166
All files in `src` will be checked, so you may want to provide `fileset`-based source instead of a whole directory.
162
167
163
168
### Return value {#tester-shellcheck-return}
164
169
165
-
A derivation that runs `shellcheck` on the given script(s).
170
+
A derivation that runs `shellcheck` on the given script(s), producing an empty output if no issues are found.
166
171
The build will fail if `shellcheck` finds any issues.
Copy file name to clipboardexpand all lines: doc/release-notes/rl-2505.section.md
+3
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,9 @@
18
18
- The hand written `perlPackages.SearchXapian` bindings have been dropped in favor of the (mostly compatible)
19
19
`perlPackages.Xapian`.
20
20
21
+
-[testers.shellcheck](https://nixos.org/manual/nixpkgs/unstable/#tester-shellcheck) now warns when `name` is not provided.
22
+
The `name` argument will become mandatory in a future release.
23
+
21
24
- The `nixLog*` family of functions made available through the standard environment have been rewritten to prefix messages with both the debug level and the function name of the caller.
22
25
The `nixLog` function, which logs unconditionally, was also re-introduced and modified to prefix messages with the function name of the caller.
23
26
For more information, [see this PR](https://github.com/NixOS/nixpkgs/pull/370742).
0 commit comments