Skip to content

Rework uucore::quoting_style, add support for locale and clocale - #14856

Merged
RenjiSann merged 9 commits into
uutils:mainfrom
RenjiSann:quoting-rework
Oct 4, 2026
Merged

RenjiSann merged 9 commits into
uutils:mainfrom
RenjiSann:quoting-rework

Conversation

@RenjiSann

@RenjiSann RenjiSann commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

This PR centralizes code that was previously duplicated in several utils.

  • Introduce locale and clocale quoting mechanisms
  • Fix fmt::Display implementation for QuotingStyle, so un-parsing a QuotingStyle gives the string value it was parsed with

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚡ 6 improved benchmarks
❌ 2 regressed benchmarks
✅ 389 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation five_38_bit_primes 1.5 s 1.8 s -17.7%
❌ Simulation split_bytes 642.4 µs 683.2 µs -5.98%
⚡ Simulation three_39_bit_primes 832.8 ms 382 ms ×2.2
⚡ Simulation file_localized_names 71.1 ms 41.4 ms +71.57%
⚡ Simulation split_number_chunks 326.3 µs 276.9 µs +17.83%
⚡ Simulation hostname_ip_lookup[100000] 176.1 µs 167.5 µs +5.13%
⚡ Simulation ls_recursive_deep_tree[(200, 2)] 3.4 ms 3.3 ms +4.53%
⚡ Simulation thirteen_39_bit_primes 9.1 s 8.8 s +3.66%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing RenjiSann:quoting-rework (5283a80) with main (01ecb91)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)

@RenjiSann
RenjiSann force-pushed the quoting-rework branch 2 times, most recently from d21d083 to 13e488b Compare September 25, 2026 13:50
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
@RenjiSann
RenjiSann force-pushed the quoting-rework branch 2 times, most recently from 8bdaa87 to b6840b9 Compare September 26, 2026 00:09
Comment thread tests/by-util/test_printenv.rs Outdated
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs
Comment thread src/uu/ls/src/config.rs
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
Comment thread src/uucore/src/lib/features/quoting_style/mod.rs
@RenjiSann
RenjiSann force-pushed the quoting-rework branch 8 times, most recently from 4704879 to 6b806e5 Compare September 28, 2026 12:51
@RenjiSann
RenjiSann requested a review from sylvestre September 28, 2026 13:26
@RenjiSann

Copy link
Copy Markdown
Collaborator Author

Pinging you again @sylvestre so we can merge this refactor as soon as possible ^^

@RenjiSann
RenjiSann requested a review from cakebaker October 2, 2026 10:05
@cakebaker

Copy link
Copy Markdown
Contributor

Sorry, there's a conflict :|

@RenjiSann

Copy link
Copy Markdown
Collaborator Author

Sorry, there's a conflict :|

Oh again :/

Splitting the `Quotes` enum allows to have a specific handling of quotes for
shell and c quoting mechanisms. Especially, this prepares the terrain for
locale quoting, which is just c quoting with UTF-8 quote characters.
- Replace C_NO_QUOTES with a new variant Escape
- Rename QuotingStyle constants
@RenjiSann

Copy link
Copy Markdown
Collaborator Author

Sorry, there's a conflict :|

@cakebaker should be good !

@codspeed

codspeed Bot commented Oct 4, 2026

Copy link
Copy Markdown

Unable to generate the flame graphs

The performance report has correctly been generated, but there was an internal error while generating the flame graphs for this run. We're working on fixing the issue. Feel free to contact us on Discord or at support@codspeed.io if the issue persists.

Comment thread src/uucore/src/lib/features/quoting_style/mod.rs Outdated
@RenjiSann
RenjiSann enabled auto-merge (rebase) October 4, 2026 14:00
@RenjiSann
RenjiSann merged commit e7c9f31 into uutils:main Oct 4, 2026
187 checks passed
@RenjiSann
RenjiSann deleted the quoting-rework branch October 5, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants