Repository navigation
Conversation
mathiasrw
added this pull request to stack #787
October 23, 2026 09:45
mathiasrw
force-pushed
the
fix/792
branch
4 times, most recently
from
October 23, 2026 10:10
eeef6d4 to
354c922
Compare
mathiasrw
marked this pull request as draft
October 23, 2026 10:21
mathiasrw
marked this pull request as ready for review
October 23, 2026 10:24
mathiasrw
marked this pull request as draft
October 23, 2026 10:40
mathiasrw
marked this pull request as ready for review
October 23, 2026 10:41
mathiasrw
marked this pull request as draft
October 23, 2026 10:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #792
Stacked on #803.
Change
--sort <how>decides the order the files are handled and printed in.naturalfile2beforefile10,a.mdbeforeB.md. The default.asciinonenatural.modifiedcreatedmodifiedis used, with a 🟡 warning.sizetrueandyesarenatural. An unknown value, or--sortwith no value, stops the run (exit code 3).asciidecides.--sort-reverseturns the order around.--sortor--sort-reversethe files are handled one at a time, so they are printed in the order of the sort. Without it the files are handled at the same time, so the order of the output can not be guaranteed, but the work is started in natural order.What breaks
naturalis the default, so the order is new: case is ignored and numbers are numbers.--sort asciigives the order from before.Speed
naturalcosts a little more thanascii. The whole command, with Bun on a Mac, 5 runs each, a pattern that finds nothing and-S, so the difference is mostly the sort:--sort ascii--sort naturalnaturalOne file is not sorted at all, so it needs no
stateither.Also in this PR
Two small README edits in "Future ideas":
json5is added to the files that could be required directly, and the idea of an automatic string search is gone.Tests
yarn test-cipasses: the demo on Node and Bun (with--sort-reverse), and 1010 Bun tests.test/engine/sort.test.js,test/engine/sort-reverse.test.jsandtest/cli/sort.test.jsare new. Three tests and one line in the demo expected the old order, and now expect the natural one.