Merge pull request #208674 from YoshiRulz/yoshi-lib-docs

lib: Fix mismatched quotes in `lib.*` doc comments

authored by Silvan Mosberger and committed by GitHub d35cae96 5e8b7993

+26 -26
+10 -10
lib/attrsets.nix
··· 88 88 else { ${elemAt attrPath n} = atDepth (n + 1); }; 89 89 in atDepth 0; 90 90 91 - /* Like `attrByPath', but without a default value. If it doesn't find the 91 + /* Like `attrByPath`, but without a default value. If it doesn't find the 92 92 path it will throw an error. 93 93 94 94 Example: ··· 274 274 # The set to get the named attributes from 275 275 attrs: genAttrs names (name: attrs.${name}); 276 276 277 - /* Collect each attribute named `attr' from a list of attribute 277 + /* Collect each attribute named `attr` from a list of attribute 278 278 sets. Sets that don't contain the named attribute are ignored. 279 279 280 280 Example: ··· 357 357 ) {} list_of_attrs; 358 358 359 359 360 - /* Recursively collect sets that verify a given predicate named `pred' 361 - from the set `attrs'. The recursion is stopped when the predicate is 360 + /* Recursively collect sets that verify a given predicate named `pred` 361 + from the set `attrs`. The recursion is stopped when the predicate is 362 362 verified. 363 363 364 364 Example: ··· 439 439 listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))); 440 440 441 441 442 - /* Like `mapAttrs', but allows the name of each attribute to be 442 + /* Like `mapAttrs`, but allows the name of each attribute to be 443 443 changed in addition to the value. The applied function should 444 - return both the new name and value as a `nameValuePair'. 444 + return both the new name and value as a `nameValuePair`. 445 445 446 446 Example: 447 447 mapAttrs' (name: value: nameValuePair ("foo_" + name) ("bar-" + value)) ··· 479 479 map (name: f name attrs.${name}) (attrNames attrs); 480 480 481 481 482 - /* Like `mapAttrs', except that it recursively applies itself to 482 + /* Like `mapAttrs`, except that it recursively applies itself to 483 483 attribute sets. Also, the first argument of the argument 484 484 function is a *list* of the names of the containing attributes. 485 485 ··· 499 499 mapAttrsRecursiveCond (as: true) f set; 500 500 501 501 502 - /* Like `mapAttrsRecursive', but it takes an additional predicate 502 + /* Like `mapAttrsRecursive`, but it takes an additional predicate 503 503 function that tells it whether to recurse into an attribute 504 - set. If it returns false, `mapAttrsRecursiveCond' does not 504 + set. If it returns false, `mapAttrsRecursiveCond` does not 505 505 recurse, but does apply the map function. If it returns true, it 506 506 does recurse, and does not apply the map function. 507 507 ··· 655 655 656 656 /* Merge sets of attributes and combine each attribute value in to a list. 657 657 658 - Like `lib.attrsets.zipAttrsWith' with `(name: values: values)' as the function. 658 + Like `lib.attrsets.zipAttrsWith` with `(name: values: values)` as the function. 659 659 660 660 Example: 661 661 zipAttrs [{a = "x";} {a = "y"; b = "z";}]
+11 -11
lib/customisation.nix
··· 3 3 rec { 4 4 5 5 6 - /* `overrideDerivation drv f' takes a derivation (i.e., the result 7 - of a call to the builtin function `derivation') and returns a new 6 + /* `overrideDerivation drv f` takes a derivation (i.e., the result 7 + of a call to the builtin function `derivation`) and returns a new 8 8 derivation in which the attributes of the original are overridden 9 - according to the function `f'. The function `f' is called with 9 + according to the function `f`. The function `f` is called with 10 10 the original derivation attributes. 11 11 12 - `overrideDerivation' allows certain "ad-hoc" customisation 12 + `overrideDerivation` allows certain "ad-hoc" customisation 13 13 scenarios (e.g. in ~/.config/nixpkgs/config.nix). For instance, 14 14 if you want to "patch" the derivation returned by a package 15 15 function in Nixpkgs to build another version than what the ··· 104 104 else result; 105 105 106 106 107 - /* Call the package function in the file `fn' with the required 107 + /* Call the package function in the file `fn` with the required 108 108 arguments automatically. The function is called with the 109 - arguments `args', but any missing arguments are obtained from 110 - `autoArgs'. This function is intended to be partially 109 + arguments `args`, but any missing arguments are obtained from 110 + `autoArgs`. This function is intended to be partially 111 111 parameterised, e.g., 112 112 113 113 callPackage = callPackageWith pkgs; ··· 116 116 libbar = callPackage ./bar.nix { }; 117 117 }; 118 118 119 - If the `libbar' function expects an argument named `libfoo', it is 119 + If the `libbar` function expects an argument named `libfoo`, it is 120 120 automatically passed as an argument. Overrides or missing 121 - arguments can be supplied in `args', e.g. 121 + arguments can be supplied in `args`, e.g. 122 122 123 123 libbar = callPackage ./bar.nix { 124 124 libfoo = null; ··· 255 255 in lib.deepSeq drv' drv'; 256 256 257 257 /* Make a set of packages with a common scope. All packages called 258 - with the provided `callPackage' will be evaluated with the same 258 + with the provided `callPackage` will be evaluated with the same 259 259 arguments. Any package in the set may depend on any other. The 260 260 `overrideScope'` function allows subsequent modification of the package 261 261 set in a consistent way, i.e. all packages in the set will be 262 262 called with the overridden packages. The package sets may be 263 263 hierarchical: the packages in the set are called with the scope 264 - provided by `newScope' and the set provides a `newScope' attribute 264 + provided by `newScope` and the set provides a `newScope` attribute 265 265 which can form the parent scope for later package sets. */ 266 266 makeScope = newScope: f: 267 267 let self = f self // {
+1 -1
lib/default.nix
··· 1 1 /* Library of low-level helper functions for nix expressions. 2 2 * 3 3 * Please implement (mostly) exhaustive unit tests 4 - * for new functions in `./tests.nix'. 4 + * for new functions in `./tests.nix`. 5 5 */ 6 6 let 7 7
+3 -3
lib/lists.nix
··· 242 242 243 243 /* Return a singleton list or an empty list, depending on a boolean 244 244 value. Useful when building lists with optional elements 245 - (e.g. `++ optional (system == "i686-linux") firefox'). 245 + (e.g. `++ optional (system == "i686-linux") firefox`). 246 246 247 247 Type: optional :: bool -> a -> [a] 248 248 ··· 283 283 */ 284 284 toList = x: if isList x then x else [x]; 285 285 286 - /* Return a list of integers from `first' up to and including `last'. 286 + /* Return a list of integers from `first` up to and including `last`. 287 287 288 288 Type: range :: int -> int -> [int] 289 289 ··· 320 320 ) { right = []; wrong = []; }); 321 321 322 322 /* Splits the elements of a list into many lists, using the return value of a predicate. 323 - Predicate should return a string which becomes keys of attrset `groupBy' returns. 323 + Predicate should return a string which becomes keys of attrset `groupBy` returns. 324 324 325 325 `groupBy'` allows to customise the combining function and initial value 326 326
+1 -1
lib/meta.nix
··· 27 27 setName = name: drv: drv // {inherit name;}; 28 28 29 29 30 - /* Like `setName', but takes the previous name as an argument. 30 + /* Like `setName`, but takes the previous name as an argument. 31 31 32 32 Example: 33 33 updateName (oldName: oldName + "-experimental") somePkg