From e3ff8dbedaa0a0ee62b98b076531dbc62da50785 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 8 Aug 2023 00:10:32 +0200 Subject: [PATCH] lib.path: Add argument docs when missing --- lib/path/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/path/default.nix b/lib/path/default.nix index 5b2f28e90dff..1a55a2a7be8d 100644 --- a/lib/path/default.nix +++ b/lib/path/default.nix @@ -307,7 +307,9 @@ in /* No rec! Add dependencies on this file at the top. */ { splitRoot "/foo/bar" => */ - splitRoot = path: + splitRoot = + # The path to split the root off of + path: assert assertMsg (isPath path) "lib.path.splitRoot: Argument is of type ${typeOf path}, but a path was expected"; @@ -466,6 +468,7 @@ in /* No rec! Add dependencies on this file at the top. */ { => */ subpath.components = + # The subpath string to split into components subpath: assert assertMsg (isValid subpath) '' lib.path.subpath.components: Argument is not a valid subpath string: