A canonical path should have all existing components canonicalized
- Vorherrschende Sprache
- C#
- Sterne
- 104
- Forks
- 15
- Ø Merge
- 9 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit AbsolutePath::Canonicalize und den Beispielen im Issue und konzentrieren Sie sich auf das Verhalten bei nicht vorhandenen Pfaden und vorhandenen Elternpfaden. Entscheiden Sie, ob CanonicalIfExists und CanonicalRecursive die geeignete API sind, einschließlich ihrer Rückgabe- und Elternkettensemantik. Als erledigt gilt die Aufgabe, wenn das Kanonisierungsverhalten und die Methodenkontrakte klar definiert und durch die relevanten Tests des Projekts abgedeckt sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- operating-systems
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100