Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Provide guarantees about portable path ordering

Open
#130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

No file or test is named in the issue. Start by locating the path ordering or comparison entry point and existing path-ordering tests; then determine how directory separators are compared across operating systems. Done means the ordering guarantee is documented and covered by tests for separator-containing relative paths.

Written by the indexing model from the issue text.

Description

enhancement good first issue help wanted

In other ecosystems (e.g. Java), I was once surprised by the following behavior.

Say you have a list of relative paths (legally distinguishable on multiple operating systems, i.e. they don't have case conflicts and mix-ups), and you sort them.

In Java, there's no guarantee you'll have the same order on all operating systems, because / and \ have different sort order, and even if you have the same path letters, you'll have different order — say, items ["a/a", "a-a", "a.a"] vs ["a-a", "a.a", @"a\a"] might be sorted differently.

A particular problem I've had with this:

> listOf(
  java.nio.file.Path.of("commons"),
  java.nio.file.Path.of("com/x")
).sortedBy { it }
// => [commons, com\x]

> listOf(
  "commons",
  "com/x"
).sortedBy { it }
// => [com/x, commons]

TruePath should guarantee the same ordering for items involving directory separators (i.e. the directory separator should have the same ordering on all the operating systems), document this and cover by tests, of course.

Dominant language
C#
Stars
104
Forks
19
Avg merge
13h 42m
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ForNeVeR/TruePath

All issues in ForNeVeR/TruePath

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.