Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2024-04-02 | lib/strings: Add makeIncludePath (#296237) | Florian Richer | 1 | -0/+12 | |
* Update strings.nix * Fix typo in docs * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Add unit test with strings * Move test to strings * Add unit test with package structure * testMakeIncludePathWithPkgs: use real pkgs * Revert "testMakeIncludePathWithPkgs: use real pkgs" This reverts commit fb1850c069cfb324f3a43323da740a27a11793f3. * Update lib/tests/misc.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/tests/misc.nix Co-authored-by: Silvan Mosberger <github@infinisil.com> --------- Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> Co-authored-by: Silvan Mosberger <github@infinisil.com> | |||||
2024-03-03 | lib.toInt/toIntBase10: Make more efficient by hoisting up internal strings ↵ | adisbladis | 1 | -10/+17 | |
into higher scope | |||||
2024-02-09 | lib.strings: Remove unneeded polyfill | Silvan Mosberger | 1 | -2/+1 | |
Nix 2.3 (the minimum version needed to evaluate Nixpkgs) supports these, so no need to keep them around. | |||||
2024-02-03 | lib: make deprecation warnings consistent | Alois Wohlschlager | 1 | -2/+2 | |
The deprecation warnings in lib were wildly inconsistent. Different formulations were used in different places for the same meaning. Some warnings used builtins.trace instead of lib.warn, which prevents silencing; one even only had a comment instead. Make everything more uniform. | |||||
2023-12-11 | Merge pull request #273473 from adisbladis/lib-isConvertibleToString-static-list | Silvan Mosberger | 1 | -2/+4 | |
lib.isConvertibleToString: Statically compute types list | |||||
2023-12-11 | lib.cmakeOptionType: Statically compute types list | adisbladis | 1 | -6/+7 | |
2023-12-11 | lib.isConvertibleToString: Statically compute types list | adisbladis | 1 | -2/+4 | |
2023-12-11 | lib.strings: Dont create scopes for getName/getVersion | adisbladis | 1 | -12/+12 | |
We can create the `parse` function in a scope one level up to avoid recomputing it every time. | |||||
2023-10-31 | lib.strings: add `replicate` | h7x4 | 1 | -0/+14 | |
`strings.replicate` returns n copies of a string, concatenated into a new string Co-authored-by: Silvan Mosberger <github@infinisil.com> | |||||
2023-10-09 | lib: refactor | Anderson Torres | 1 | -12/+15 | |
- rename `(enable|with)Feature(As|)` inputs to more descriptive names | |||||
2023-09-27 | lib: add cmakeOptionType, cmakeBool and cmakeFeature | Anderson Torres | 1 | -0/+58 | |
2023-08-14 | lib.removePrefix: Optimise | Silvan Mosberger | 1 | -2/+2 | |
2023-06-22 | lib: simplify stringToCharacters | figsoda | 1 | -1/+2 | |
2023-06-15 | lib.path.hasPrefix: init | Silvan Mosberger | 1 | -1/+2 | |
2023-04-04 | Merge pull request #221204 from tweag/deprecate-paths-to-strings | Silvan Mosberger | 1 | -11/+75 | |
lib.strings: Prevent paths as inputs in some functions | |||||
2023-03-15 | lib.strings.remove{Prefix,Suffix}: Deprecate for path prefix/suffix arguments | Silvan Mosberger | 1 | -5/+23 | |
See also parent commits | |||||
2023-03-15 | lib.strings.normalizePath: Deprecate for path values | Silvan Mosberger | 1 | -1/+14 | |
There's no need to call this function on path data types, and it's confusing with the new lib.path library functions | |||||
2023-03-15 | lib.strings: Deprecate path prefix/suffix/infix arguments | Silvan Mosberger | 1 | -5/+38 | |
lib.{hasPrefix,hasInfix,hasSuffix} would otherwise return an always-false result, which can be very unexpected: nix-repl> lib.strings.hasPrefix ./lib ./lib/meta.nix false | |||||
2023-03-04 | lib/strings: hide asciiTable | Naïm Favier | 1 | -2/+2 | |
Since it's an attribute set, the lib function location generating code tries to generate locations for each of the characters... | |||||
2023-03-03 | strings: add escapeQuery for url encoding | Patrick Widmer | 1 | -3/+18 | |
2023-01-31 | Merge pull request #205557 from ncfavier/concatLines | Silvan Mosberger | 1 | -0/+11 | |
lib/strings: add `concatLines` | |||||
2022-12-31 | lib.isStringLike: Remove use of list | Robert Hensing | 1 | -1/+3 | |
In the current implementation of Nix, this list would be allocated over and over. Iirc pennae tried to optimize static list allocation, but gained no significant performance improvement. | |||||
2022-12-31 | lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike | Robert Hensing | 1 | -4/+3 | |
2022-12-31 | lib.strings: isMoreCoercibleString -> isConvertibleWithToString | Robert Hensing | 1 | -5/+6 | |
Yes, this function name is inconveniently long, but it is important for the name to explicitly reference the function and not be mistaken for the implicit string conversions, which only happen for a smaller set of values. | |||||
2022-12-31 | lib.strings: isSimpleCoercibleString -> isStringLike | Robert Hensing | 1 | -7/+7 | |
2022-12-31 | treewide: isCoercibleToString -> isMoreCoercibleToString | Robert Hensing | 1 | -1/+1 | |
No change in behavior. | |||||
2022-12-31 | lib.strings: Rename isCoercibleToString -> isMoreCoercibleToString | Robert Hensing | 1 | -2/+11 | |
2022-12-31 | lib.strings.toShellVar: Use isSimpleCoercibleString | Robert Hensing | 1 | -1/+1 | |
Expecting no change in behavior. | |||||
2022-12-31 | lib.strings.isStorePath: Use isSimpleCoercibleToString | Robert Hensing | 1 | -1/+1 | |
Expecting no change in behavior. | |||||
2022-12-31 | lib.strings: Add isSimpleCoercibleToString | Robert Hensing | 1 | -0/+11 | |
2022-12-20 | lib/strings: replace poop emoji (#206999) | Naïm Favier | 1 | -1/+1 | |
2022-12-17 | lib: fix typos | figsoda | 1 | -2/+2 | |
2022-12-15 | lib.replaceChars: warn about being a deprecated alias | Artturin | 1 | -17/+6 | |
replaceStrings has been in nix since 2015(nix 1.10) so it is safe to remove the fallback https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb | |||||
2022-12-11 | Merge pull request #205457 from ↵ | Robert Hensing | 1 | -6/+7 | |
h7x4/lib-strings-toInt-broken-for-negative-numbers lib.strings: fix negative number handling for `toInt` and `toIntBase10` | |||||
2022-12-10 | lib/strings: add `concatLines` | Naïm Favier | 1 | -0/+11 | |
Like `unlines` from Haskell. The aim is to replace the `concatStringsSep "\n"` pattern for generated files, which doesn't add a final newline. | |||||
2022-12-10 | lib.strings: fix negative number handling for `toInt` and `toIntBase10` | h7x4 | 1 | -6/+7 | |
The previous version would be unstable due to an input validation regex not expecting a '-' in front of the number. | |||||
2022-12-08 | Merge pull request #204087 from ncfavier/splitString-simplify | Naïm Favier | 1 | -6/+4 | |
2022-12-06 | lib/strings.nix: add mesonOption utility function | AndersonTorres | 1 | -0/+55 | |
And some friends, to help write Meson commandline invocations. | |||||
2022-12-02 | lib/strings: simplify `splitString` | Naïm Favier | 1 | -6/+4 | |
There's no need to use `unsafeDiscardStringContext` since https://github.com/NixOS/nix/commit/ee7fe64c0ac00f2be11604a2a6509eb86dc19f0a (Nix 1.8). Also the separator can't have a context since `builtins.split` would fail, so we can assume it doesn't. | |||||
2022-10-24 | Merge pull request #173949 from jacoblambda/fix-toInt-zero-padding | Robert Hensing | 1 | -6/+87 | |
lib: add strings.toIntBase10 to parse zero-padded strings | |||||
2022-10-24 | lib.normalizePath: the empty string is not a valid regex on darwin | Guillaume Girol | 1 | -1/+1 | |
presumably due to using libc++'s regex lib instead of libstdc++ on linux Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800 | |||||
2022-10-23 | lib/strings: Update docs and restructured code to improve readability of ↵ | Jacob Abel | 1 | -21/+37 | |
toInt and toIntBase10. | |||||
2022-10-23 | lib/strings: Improve error message for octal ambiguity in toInt | Jacob Abel | 1 | -3/+2 | |
2022-10-23 | lib/strings: Refactor toInt into toInt and toIntBase10 | Jacob Abel | 1 | -3/+51 | |
2022-10-23 | lib/strings: Update toInt to handle intermixed ws and zeros. Added tests | Jacob Abel | 1 | -7/+13 | |
2022-10-23 | lib/strings: allow toInt to parse zero-padded strings | Jacob Abel | 1 | -4/+16 | |
2022-10-20 | lib.strings: Add normalizePath | ajs124 | 1 | -0/+10 | |
dedupes extranous /'s in filepaths Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com> | |||||
2022-10-20 | lib.strings: Add function to do C-style escaping | Daniel Olsen | 1 | -0/+13 | |
2022-10-20 | lib.strings: Add function to convert character to number | Daniel Olsen | 1 | -0/+15 | |
2022-05-07 | lib/strings/toShellVars: handle derivations as strings | Naïm Favier | 1 | -4/+5 | |