ForNeVeR / ForNeVeR/TruePath

A canonical path should have all existing components canonicalized

Open
#128 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
C#
Stars
104
Forks
15
Avg merge
9m
Merged PRs (30d)
2

Description

Currently, `AbsolutePath::Canonicalize` will mostly do nothing for a non-existing path, it will be returned as-is.

Which is mostly fine, but might cause misinterpretation on the user's side: e.g. while `myPath.Canonicalize()` is okay-ish and follows the spec "canonical if exists", `myPath.Canonicalize().Parent` is not okay — if `myPath` doesn't exist then this will _not_ be canonicalized, even if existing.

We should think about this situation, perhaps let's introduce two more methods?
- `CanonicalIfExists(): AbsolutePath?`
- `CanonicalRecursive(): AbsolutePath` — which will essentially do `CanonicalIfExists() ?? Parent.CanonicalRecursive() / FileName` — e.g. will try to canonicalize existing parent chain whenever possible

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.