Commit Graph

17 Commits

Author SHA1 Message Date
Silvan Mosberger
d4b7b15407 lib.path.hasStorePathPrefix: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-12-13 17:12:52 +01:00
Silvan Mosberger
055ba65fed lib: Take advantage of section descriptions
See https://github.com/nix-community/nixdoc/releases/tag/v2.6.0
2023-11-20 03:02:11 +01:00
Silvan Mosberger
e3ff8dbeda lib.path: Add argument docs when missing 2023-08-08 00:10:32 +02:00
Silvan Mosberger
dee307ff30 lib.path: Indent comments the same 2023-08-08 00:09:08 +02:00
Silvan Mosberger
b5c492b4ba lib.path: Make documentation more uniform
- Always have a trailing dot after sentences
- Link more things
- Fix some formatting
- Use `append` instead of `+ ("/"`
2023-08-08 00:06:27 +02:00
Robert Hensing
8fa169707f
Merge pull request #242695 from tweag/lib.path.subpath.components
`lib.path.subpath.components`: init
2023-08-04 17:00:46 +02:00
Silvan Mosberger
4e14f5fee6 lib.path.subpath.components: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-26 23:29:44 +02:00
Silvan Mosberger
d7bf0d777a lib.path.subpath.isValid: Add definition of a subpath
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-26 23:20:19 +02:00
Silvan Mosberger
b42e178ed4 lib.path.splitRoot: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-07-26 23:20:12 +02:00
Silvan Mosberger
6626d8cc4d lib.path.removePrefix: init 2023-07-10 21:25:43 +02:00
Silvan Mosberger
592213ad3f lib.path.hasPrefix: init 2023-06-15 22:29:46 +02:00
Silvan Mosberger
866f75e5b9 lib.path.append: Add a law
With removePrefix introduced in a future commit this law can then be
used to derive

        removePrefix p (append p s) == subpath.normalise s
        => (wrap with append)
        append p (removePrefix p (append p s)) == append p (subpath.normalise s)
        => (append is not influenced by subpath normalisation)
        append p (removePrefix p (append p s)) == append p s
        => (substitute q = append p s)
        append p (removePrefix p q) == q

Not included in the docs because it's not that important, just shows
that the first statement is more general than the second one (because
this derivation doesn't work the other way)
2023-04-05 20:27:46 +02:00
Silvan Mosberger
1a2c2846b0 lib.path.subpath.join: init
This function can be used to safely join subpaths together
2023-02-13 14:01:17 +01:00
Silvan Mosberger
eac2538707 lib.path.append: init
This function can be used to append strings to Nix path values in a
safe way.
2023-01-18 20:17:31 +01:00
Silvan Mosberger
5c4f616198 lib.path: Minor improvements
- Use isValid when possible instead of subpathInvalidReason: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068714681
- Add documentation to function arguments
- Use newlines for error messages: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1069737602
- Add short comments for the unit test groups: https://github.com/NixOS/nixpkgs/pull/208887#discussion_r1072913051
- Slight formatting improvement for laws: https://github.com/NixOS/nixpkgs/pull/209099#discussion_r1068707955
2023-01-18 18:19:17 +01:00
Silvan Mosberger
63dd6d20db lib.path.subpath.normalise: init 2023-01-03 13:21:03 +01:00
Silvan Mosberger
98fbcf1788 lib.path.subpath.isValid: init
The first path library function
2023-01-03 13:20:36 +01:00