Skip to content

test: fix man page formatting by adding blank lines in after-help text#9005

Open
Agent-Hellboy wants to merge 8 commits into
uutils:mainfrom
Agent-Hellboy:fix-8362
Open

test: fix man page formatting by adding blank lines in after-help text#9005
Agent-Hellboy wants to merge 8 commits into
uutils:mainfrom
Agent-Hellboy:fix-8362

Conversation

@Agent-Hellboy

@Agent-Hellboy Agent-Hellboy commented Oct 25, 2025

Copy link
Copy Markdown

fixes #8362

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@matttbe matttbe 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.

@Agent-Hellboy thanks for fixing that! I just did (almost) the same on my side, then I saw your PR :)

I think you need more new lines: on my side, I had to double each new line in the test-after-help section, see: https://manpages.ubuntu.com/manpages/questing/en/man1/test.1.html


File operations:
- FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers
- FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2

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.

Sorry, I didn't mean doubling the lines you already did below, but all the ones here and above.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ohh sorry

@Agent-Hellboy Agent-Hellboy Oct 25, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Let me find all instances and fix it

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

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

@matttbe matttbe 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.

Almost there I think


- EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true

String operations:

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.

You also need a newline here below


- STRING1 != STRING2 the strings are not equal

Integer comparisons:

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.

Same here below


- INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2

File operations:

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.

Same here below


- EXPRESSION1 -o EXPRESSION2 EXPRESSION1 ou EXPRESSION2 est vraie

Opérations sur les chaînes :

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.

Same here below


- STRING1 != STRING2 les chaînes ne sont pas égales

Comparaisons d'entiers :

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.

Same here below


- INTEGER1 -ne INTEGER2 INTEGER1 n'est pas égal à INTEGER2

Opérations sur les fichiers :

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.

Same here below

@Agent-Hellboy

Copy link
Copy Markdown
Author
Screenshot 2025-10-26 at 4 30 52 pm I hope it's okay now

@matttbe matttbe 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.

It looks like you added new lines above my comments, not below.

On the screenshot, the first entry is on the same line as the list introduction line.

@sylvestre

Copy link
Copy Markdown
Contributor

could you please add a test that would verify that the manpage output is correct ? thanks

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@Agent-Hellboy

Copy link
Copy Markdown
Author

It looks like you added new lines above my comments, not below.

On the screenshot, the first entry is on the same line as the list introduction line.

Ohh, sorry , I can also see it😬

@Agent-Hellboy

Copy link
Copy Markdown
Author

could you please add a test that would verify that the manpage output is correct ? thanks

Sure thing.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@Agent-Hellboy

Copy link
Copy Markdown
Author

@matttbe I guess CI failures are not related.

@cakebaker

Copy link
Copy Markdown
Contributor

@Agent-Hellboy I think the Code Quality checks and the CICD / Build check are related to this PR :|

@Agent-Hellboy

Copy link
Copy Markdown
Author

@Agent-Hellboy I think the Code Quality checks and the CICD / Build check are related to this PR :|

Yeah, I expanded and saw

@matttbe matttbe 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.

Thanks for the last update. The modifications in the man pages look good to me. It is similar to what I did, except that in your version, you added an extra new line (2 in total then) before each list introduction sentence, but I guess that's fine.

Regarding the tests, I'm not sure how they work, but could you eventually have a generic version that is not specific to the test man pages? e.g. each line starting with a - should have an empty new line before?

If you do that, please add a link to the bug report or PR you opened in the other project to render this part correctly. So when this part is fixed, the test can be adapted.

@Agent-Hellboy

Copy link
Copy Markdown
Author

@matttbe, first of all, I apologize for not verifying my change closely enough several times.

I'm not sure how they work, but could you eventually have a generic version that is not specific to the test man pages?

sure, but we need to validate for test.

e.g. each line starting with a - should have an empty new line before?

Yeah I did that please check

If you do that, please add a link to the bug report or PR you opened in the other project to render this part correctly. So when this part is fixed, the test can be adapted.

sure

@matttbe

matttbe commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

sure, but we need to validate for test.

OK, I don't exactly know the policy for this project, but the tests you added might be enough. I hope someone else will be able to comment about that.

e.g. each line starting with a - should have an empty new line before?

Yeah I did that please check

I'm not sure that's what you did. What I meant is that the formatting issue is not specific to the test man page, but for all man pages. So ideally, it would be nice to ensure all lists (a line starting with a dash) defined in the test-after-help section are preceded by an empty line. Au last until this bug is solved: clap-rs/clap#6087

I don't know if you can use regex with multiple lines but you should not have any hits for something like this in the test-after-help section: [^\n]\n\s*- (not tested, I'm on my phone).
Would it not work? (Can eventually be part of another PR, not sure what's the policy here)

@codspeed-hq

codspeed-hq Bot commented Oct 26, 2025

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 103 untouched benchmarks
🗄️ 1 archived benchmark run1


Comparing Agent-Hellboy:fix-8362 (9113c0a) with main (3b2cb6a)

Open in CodSpeed

Footnotes

  1. 1 benchmark was run, but is now archived. If it was deleted in another branch, consider rebasing to remove it from the report. Instead if it was added back, click here to restore it.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@Agent-Hellboy

Agent-Hellboy commented Oct 27, 2025

Copy link
Copy Markdown
Author

I'm not sure that's what you did. What I meant is that the formatting issue is not specific to the test man page, but for all man pages. So ideally, it would be nice to ensure all lists (a line starting with a dash) defined in the test-after-help section are preceded by an empty line. Au last until this bug is solved: clap-rs/clap#6087

I guess we need to add a comment in ftl files. As these tests are integration test and just check the man file formatting, it doesn't care about how it gets generated and all

I don't know if you can use regex with multiple lines but you should not have any hits for something like this in the test-after-help section: [^\n]\n\s*- (not tested, I'm on my phone).
Would it not work? (Can eventually be part of another PR, not sure what's the policy here)

I guess it's okay, but if you want, I can add regex for this kind of validation in some other PR.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@matttbe matttbe 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.

Thanks for the last update!

The code looks good to me, but I'm not part of the project, and I don't know the policy around the tests. I have one suggestion, but this PR is maybe not the right place to do that, I don't know.

Hopefully someone from the project can continue the review :)

Comment thread tests/uudoc/mod.rs
// the formatting issue is consistent across all utilities

// Test a representative sample of utilities
let utilities_to_test = vec!["cat", "test", "wc", "uniq", "echo", "head", "tail", "cut"];

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.

Why only a selection? Is it not possible to check all man pages? All of them should be properly formatted.

(Or maybe it is not the right place for that kind of tests?)

@matttbe

matttbe commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

I don't know if you can use regex with multiple lines but you should not have any hits for something like this in the test-after-help section: [^\n]\n\s*- (not tested, I'm on my phone).
Would it not work? (Can eventually be part of another PR, not sure what's the policy here)

I guess it's okay, but if you want, I can add regex for this kind of validation in some other PR.

What you did looks good to me:

  • if a line ends with :, it should be followed by an empty line
  • if a line starts with -, there should be an empty line before

Would be even better if this check is done for all man-pages, but not sure what's possible there.

One last thing: the CI spot some issues. It looks like they are related to your new tests.

@matttbe matttbe 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.

the modifications in the .ftl look good to me. The CI is complaining about the rest. Can someone review the rest please?

@matttbe matttbe 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.

(sorry, just to avoid confusions, better mark this PR as "Request changes")

@Agent-Hellboy

Copy link
Copy Markdown
Author

Thanks @matttbe for the review and being patient, I will look at everything carefully after the festival ends at my place, I don't want to rush on anything now.

@matttbe

matttbe commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

@Agent-Hellboy if having tests checking if a newline is added after each line ending with : in all man pages using after_help, maybe the fix and the tests should be split?

Having a fix for the unreadable test man page might be better to have than checking for future regressions due to an external lib not handling formatting in the after_help part?

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.

man 1 test is badly formated

4 participants