Skip to content

clap/locale: fix the colors for all programs (Closes: #8501) - #8542

Merged
cakebaker merged 1 commit into
uutils:mainfrom
sylvestre:clap-loca-improv-2
Sep 5, 2025
Merged

clap/locale: fix the colors for all programs (Closes: #8501)#8542
cakebaker merged 1 commit into
uutils:mainfrom
sylvestre:clap-loca-improv-2

Conversation

@sylvestre

@sylvestre sylvestre commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

and add tests to make sure we don't regress in the future

@sylvestre

Copy link
Copy Markdown
Contributor Author

Some GNU tests will fail.

@github-actions

github-actions Bot commented Sep 1, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mv/diag. tests/mv/diag is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)

@github-actions

github-actions Bot commented Sep 2, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@github-actions

github-actions Bot commented Sep 2, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/invalid-opt. tests/misc/invalid-opt is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/uniq/uniq. tests/uniq/uniq is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@sylvestre
sylvestre force-pushed the clap-loca-improv-2 branch 2 times, most recently from 5e23a1b to 12220a7 Compare September 3, 2025 17:57
@github-actions

github-actions Bot commented Sep 3, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre
sylvestre marked this pull request as ready for review September 3, 2025 18:47
@sylvestre
sylvestre requested a review from cakebaker September 3, 2025 18:47
@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment on lines 560 to 568

@cakebaker cakebaker Sep 4, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This snippet is almost identical with the should_use_color_stderr function, the only difference is in what is passed to is_terminal. Maybe should_use_color_stderr can be made more flexible so that it can be used here, too?

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm undecided whether a ColorManager concept is necessary or a bool property in ErrorFormatter would be enough.

Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uucore/src/lib/mods/clap_localization.rs Outdated
Comment thread src/uu/users/src/users.rs Outdated
Comment thread src/uu/stat/src/stat.rs Outdated
Comment thread src/uu/printenv/src/printenv.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Comment thread src/uu/runcon/src/runcon.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Comment thread src/uu/runcon/src/runcon.rs Outdated
Comment thread src/uu/truncate/src/truncate.rs Outdated
Comment thread src/uu/truncate/src/truncate.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Comment thread src/uu/uniq/src/uniq.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Comment thread src/uu/who/src/who.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for splitting the setup of command into two parts? Why not doing the localization at the end?

Comment thread util/build-gnu.sh Outdated
Comment thread util/gnu-patches/tests_comm.pl.patch Outdated
Comment thread util/gnu-patches/tests_factor_factor.pl.patch Outdated
Comment thread util/gnu-patches/tests_tsort.patch Outdated

@cakebaker cakebaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/basenc/basenc. tests/basenc/basenc is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/factor/factor. tests/factor/factor is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/misc/comm. tests/misc/comm is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

@sylvestre
sylvestre force-pushed the clap-loca-improv-2 branch 3 times, most recently from 251e258 to ee0fae5 Compare September 4, 2025 21:26
@github-actions

github-actions Bot commented Sep 4, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/ls/no-cap is now being skipped but was previously passing.

@sylvestre
sylvestre requested a review from cakebaker September 4, 2025 21:49
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@github-actions

github-actions Bot commented Sep 5, 2025

Copy link
Copy Markdown

GNU testsuite comparison:

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

@cakebaker
cakebaker merged commit 303a211 into uutils:main Sep 5, 2025
131 of 136 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Good work :)

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.

2 participants