| Commit message (Expand) | Author | Age | Files | Lines |
| * | Doc: migrate lib.strings to commonmark | Johannes Kirschbauer | 2024-07-27 | 1 | -564/+2002 |
| * | lib.trimWith: Minor doc improvements | Silvan Mosberger | 2024-07-26 | 1 | -3/+4 |
| * | lib.strings: add `trim` and `trimWith`•••`strings.trim` returns a copy of the string with all leading and trailing
whitespace removed.
`strings.trimWith` does the same thing, but calling code can decide
whether to trim the start and/or end of the string.
| Matt Sturgeon | 2024-07-25 | 1 | -0/+62 |
| * | lib/strings: Add makeIncludePath (#296237)•••* 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> | Florian Richer | 2024-04-02 | 1 | -0/+12 |
| * | lib.toInt/toIntBase10: Make more efficient by hoisting up internal strings in... | adisbladis | 2024-03-03 | 1 | -10/+17 |
| * | lib.strings: Remove unneeded polyfill•••Nix 2.3 (the minimum version needed to evaluate Nixpkgs) supports these, so no need to keep them around.
| Silvan Mosberger | 2024-02-09 | 1 | -2/+1 |
| * | lib: make deprecation warnings consistent•••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.
| Alois Wohlschlager | 2024-02-03 | 1 | -2/+2 |
| * | Merge pull request #273473 from adisbladis/lib-isConvertibleToString-static-list•••lib.isConvertibleToString: Statically compute types list | Silvan Mosberger | 2023-12-11 | 1 | -2/+4 |
| |\ |
|
| | * | lib.isConvertibleToString: Statically compute types list | adisbladis | 2023-12-11 | 1 | -2/+4 |
| * | | lib.cmakeOptionType: Statically compute types list | adisbladis | 2023-12-11 | 1 | -6/+7 |
| |/ |
|
| * | lib.strings: Dont create scopes for getName/getVersion•••We can create the `parse` function in a scope one level up to avoid recomputing it every time.
| adisbladis | 2023-12-11 | 1 | -12/+12 |
| * | lib.strings: add `replicate`•••`strings.replicate` returns n copies of a string, concatenated into a new
string
Co-authored-by: Silvan Mosberger <github@infinisil.com>
| h7x4 | 2023-10-31 | 1 | -0/+14 |
| * | lib: refactor•••- rename `(enable|with)Feature(As|)` inputs to more descriptive names
| Anderson Torres | 2023-10-09 | 1 | -12/+15 |
| * | lib: add cmakeOptionType, cmakeBool and cmakeFeature | Anderson Torres | 2023-09-27 | 1 | -0/+58 |
| * | lib.removePrefix: Optimise | Silvan Mosberger | 2023-08-14 | 1 | -2/+2 |
| * | lib: simplify stringToCharacters | figsoda | 2023-06-22 | 1 | -1/+2 |
| * | lib.path.hasPrefix: init | Silvan Mosberger | 2023-06-15 | 1 | -1/+2 |
| * | Merge pull request #221204 from tweag/deprecate-paths-to-strings•••lib.strings: Prevent paths as inputs in some functions | Silvan Mosberger | 2023-04-04 | 1 | -11/+75 |
| |\ |
|
| | * | lib.strings.remove{Prefix,Suffix}: Deprecate for path prefix/suffix arguments•••See also parent commits
| Silvan Mosberger | 2023-03-15 | 1 | -5/+23 |
| | * | lib.strings.normalizePath: Deprecate for path values•••There's no need to call this function on path data types, and it's
confusing with the new lib.path library functions
| Silvan Mosberger | 2023-03-15 | 1 | -1/+14 |
| | * | lib.strings: Deprecate path prefix/suffix/infix arguments•••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
| Silvan Mosberger | 2023-03-15 | 1 | -5/+38 |
| * | | lib/strings: hide asciiTable•••Since it's an attribute set, the lib function location generating code
tries to generate locations for each of the characters...
| Naïm Favier | 2023-03-04 | 1 | -2/+2 |
| * | | strings: add escapeQuery for url encoding | Patrick Widmer | 2023-03-03 | 1 | -3/+18 |
| |/ |
|
| * | Merge pull request #205557 from ncfavier/concatLines•••lib/strings: add `concatLines` | Silvan Mosberger | 2023-01-31 | 1 | -0/+11 |
| |\ |
|
| | * | lib/strings: add `concatLines`•••Like `unlines` from Haskell.
The aim is to replace the `concatStringsSep "\n"` pattern for generated
files, which doesn't add a final newline.
| Naïm Favier | 2022-12-10 | 1 | -0/+11 |
| * | | lib.isStringLike: Remove use of list•••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.
| Robert Hensing | 2022-12-31 | 1 | -1/+3 |
| * | | lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike | Robert Hensing | 2022-12-31 | 1 | -4/+3 |
| * | | lib.strings: isMoreCoercibleString -> isConvertibleWithToString•••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.
| Robert Hensing | 2022-12-31 | 1 | -5/+6 |
| * | | lib.strings: isSimpleCoercibleString -> isStringLike | Robert Hensing | 2022-12-31 | 1 | -7/+7 |
| * | | treewide: isCoercibleToString -> isMoreCoercibleToString•••No change in behavior.
| Robert Hensing | 2022-12-31 | 1 | -1/+1 |
| * | | lib.strings: Rename isCoercibleToString -> isMoreCoercibleToString | Robert Hensing | 2022-12-31 | 1 | -2/+11 |
| * | | lib.strings.toShellVar: Use isSimpleCoercibleString•••Expecting no change in behavior.
| Robert Hensing | 2022-12-31 | 1 | -1/+1 |
| * | | lib.strings.isStorePath: Use isSimpleCoercibleToString•••Expecting no change in behavior.
| Robert Hensing | 2022-12-31 | 1 | -1/+1 |
| * | | lib.strings: Add isSimpleCoercibleToString | Robert Hensing | 2022-12-31 | 1 | -0/+11 |
| * | | lib/strings: replace poop emoji (#206999) | Naïm Favier | 2022-12-20 | 1 | -1/+1 |
| * | | lib: fix typos | figsoda | 2022-12-17 | 1 | -2/+2 |
| * | | lib.replaceChars: warn about being a deprecated alias•••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
| Artturin | 2022-12-15 | 1 | -17/+6 |
| * | | Merge pull request #205457 from h7x4/lib-strings-toInt-broken-for-negative-nu...•••lib.strings: fix negative number handling for `toInt` and `toIntBase10` | Robert Hensing | 2022-12-11 | 1 | -6/+7 |
| |\ \
| |/
|/| |
|
| | * | lib.strings: fix negative number handling for `toInt` and `toIntBase10`•••The previous version would be unstable due to an input validation regex
not expecting a '-' in front of the number.
| h7x4 | 2022-12-10 | 1 | -6/+7 |
| * | | Merge pull request #204087 from ncfavier/splitString-simplify | Naïm Favier | 2022-12-08 | 1 | -6/+4 |
| |\ \ |
|
| | * | | lib/strings: simplify `splitString`•••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.
| Naïm Favier | 2022-12-02 | 1 | -6/+4 |
| | |/ |
|
| * / | lib/strings.nix: add mesonOption utility function•••And some friends, to help write Meson commandline invocations.
| AndersonTorres | 2022-12-06 | 1 | -0/+55 |
| |/ |
|
| * | Merge pull request #173949 from jacoblambda/fix-toInt-zero-padding•••lib: add strings.toIntBase10 to parse zero-padded strings | Robert Hensing | 2022-10-24 | 1 | -6/+87 |
| |\ |
|
| | * | lib/strings: Update docs and restructured code to improve readability of toIn... | Jacob Abel | 2022-10-23 | 1 | -21/+37 |
| | * | lib/strings: Improve error message for octal ambiguity in toInt | Jacob Abel | 2022-10-23 | 1 | -3/+2 |
| | * | lib/strings: Refactor toInt into toInt and toIntBase10 | Jacob Abel | 2022-10-23 | 1 | -3/+51 |
| | * | lib/strings: Update toInt to handle intermixed ws and zeros. Added tests | Jacob Abel | 2022-10-23 | 1 | -7/+13 |
| | * | lib/strings: allow toInt to parse zero-padded strings | Jacob Abel | 2022-10-23 | 1 | -4/+16 |
| * | | lib.normalizePath: the empty string is not a valid regex on darwin•••presumably due to using libc++'s regex lib instead of libstdc++ on linux
Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800
| Guillaume Girol | 2022-10-24 | 1 | -1/+1 |
| |/ |
|
| * | lib.strings: Add normalizePath•••dedupes extranous /'s in filepaths
Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com>
| ajs124 | 2022-10-20 | 1 | -0/+10 |