Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint all manpages at default level #12129

Closed
wants to merge 2 commits into from

Conversation

nabijaczleweli
Copy link
Contributor

@nabijaczleweli nabijaczleweli commented May 27, 2021

Motivation and Context

#12125 (comment)

Description

On top of #12125 right now, but uhh see first commit for the linter impl, rest are generated; it might be preferable to squash them (all? except for a few?)

Also general cleanup and/or style alignment of the manpages I touch anyway and flattening single-variant subcommands

Posting this because I'll forget otherwise and my wrist is killing me so I won't forseeably finish this in this sitting

How Has This Been Tested?

Looked at it

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@nabijaczleweli nabijaczleweli force-pushed the old-new-stock branch 2 times, most recently from 3092a8b to 3c686b8 Compare May 27, 2021 13:40
@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented May 27, 2021

Okay, that's all of them. Open questions for someone with a fresh pair of eyes and/or understanding:

  1. zfs-jail was kinda soupy, I desoupified it, but it could still be wet?
  2. zfs-project was as well, to a lesser extent, and what triggered Set mode was unclear to me: I assumed it's zfs project -p id with no other flags – is that right?
  3. The one .br subcommand in zfs send --redact redaction_bookmark [-DLPcenpv] [-i snapshot|bookmark] snapshot (here and here): is it just line-broken (which is what I assumed) or is it two commands with the same description?

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented May 29, 2021

For later reference, these are the pages untouched by this and #12125:

  • man/man5/spl-module-parameters.5
  • man/man5/zfs-module-parameters.5
  • man/man5/zpool-features.5
  • man/man8/zfs-mount-generator.8.in
  • man/man8/zfs-wait.8
  • man/man8/zpool-destroy.8
  • man/man8/zpool-export.8
  • man/man8/zpool-history.8
  • man/man8/zpool-labelclear.8
  • man/man8/zpool-reguid.8

@nabijaczleweli nabijaczleweli force-pushed the old-new-stock branch 2 times, most recently from 57a3938 to 60fe438 Compare May 29, 2021 17:50
@behlendorf
Copy link
Contributor

@nabijaczleweli this can now be rebased on master which includes the modernization patches.

@nabijaczleweli nabijaczleweli marked this pull request as ready for review May 30, 2021 09:11
@nabijaczleweli
Copy link
Contributor Author

Rebased, tentatively undrafting, but #12129 (comment) still stands

@nabijaczleweli
Copy link
Contributor Author

Rebased

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Jun 1, 2021

Well, man/man?/Makefile.ams all replace .Os with .Os Linux in the install hook (which isn't necessarily right, but I have something staged for later for this) for this reason exactly, and it's a mandoc lint to set .Os FreeBSD:

       operating system explicitly specified
       (mdoc, OpenBSD, NetBSD) The Os macro has an argument.  In the base system, it is conventionally left blank.
nabijaczleweli@tarta:~/store/code/zfs$ make mancheck
./scripts/mancheck.sh ./man ./tests/test-runner/man
mandoc: ./man/man8/zfs-jail.8:41:5: STYLE: operating system explicitly specified: Os FreeBSD (NetBSD)
make: *** [Makefile:1520: mancheck] Error 1

Plus, making it just .Os is consistent with every other manpage we ship.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Jun 1, 2021
@tonynguien tonynguien requested review from rlaager and a user June 1, 2021 22:08
Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

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

In general, this looks good. It's a pretty big changeset in terms of diff size, so I admit I skimmed a bit. But I did skim all of the commits and I did quickly view all of the man pages.

I left a few comments. A bunch were about making the pluralization of the summary match the behavior of the command. For example, if a command acts on one pool, it should say "... a ZFS storage pool" and if it can act on multiple pools, it should say "... ZFS storage pools".

I tried to mark things "maybe" where I wasn't sure.

@nabijaczleweli Can you make one pass through to check the pluralization and merge anything else that seems sane? Then (barring objections), we should be able to get this merged.

man/man8/zpool-reopen.8 Outdated Show resolved Hide resolved
man/man8/zpool-split.8 Outdated Show resolved Hide resolved
man/man8/zpool-split.8 Outdated Show resolved Hide resolved
man/man8/zpool-sync.8 Outdated Show resolved Hide resolved
man/man8/zfs-create.8 Outdated Show resolved Hide resolved
man/man8/zpool-resilver.8 Outdated Show resolved Hide resolved
man/man8/zpool-scrub.8 Outdated Show resolved Hide resolved
man/man8/zpool-trim.8 Outdated Show resolved Hide resolved
man/man8/zpool-upgrade.8 Show resolved Hide resolved
man/man8/zpool-wait.8 Show resolved Hide resolved
@nabijaczleweli
Copy link
Contributor Author

In rereading some pages, it turned out I just delinted some of them without fixing the glaring holes – this has been addressed, alongside some titles, as seen above.

I've amended all pages to where they should be, but here's the interdiff from the version you reviewed: inter.diff.gz

@nabijaczleweli nabijaczleweli force-pushed the old-new-stock branch 2 times, most recently from b64aeb6 to 518bf04 Compare June 2, 2021 03:10
@rlaager
Copy link
Member

rlaager commented Jun 2, 2021

Skimming the interdiff, that looks fine to me. I see you've replaced ... with an actual ellipse character, but that's probably fine. After all, it's 2021 and Unicode support should be reasonably prevalent. I'm not sure that we need to cater to anything non-UTF-8.

@nabijaczleweli
Copy link
Contributor Author

Yeah, I've already done that intermittently but decided to enforce it on all arguments for consistency (and because it looks infinitely better, and isn't three full cells wide)

Copy link
Contributor

@tonynguien tonynguien left a comment

Choose a reason for hiding this comment

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

It's a big change :) Thank you.

I confirmed mandoc -Tlint no longer complains about these files though I only skimmed through the diffs.

Can you squash the commits keeping only those worth preserving? A single a commit would be good too.

@nabijaczleweli
Copy link
Contributor Author

nabijaczleweli commented Jun 2, 2021

Squashed all manpage commits into one big one

Copy link
Member

@rlaager rlaager left a comment

Choose a reason for hiding this comment

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

With the caveat that I don't agree with dropping articles ("a", "an", "the") from the command summaries (both because it reads better and because I think it subtly provides useful information about whether the command acts on a single or multiple objects), I think this is good to merge.

scripts/mancheck.sh Show resolved Hide resolved
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

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

zfs-jail was kinda soupy, I desoupified it, but it could still be wet?

The updated version looks right to me. My only thought is it wouldn't be bad to make it very clear this functionality only applies to FreeBSD. Of course, it's probably not needed since it's right there in the name, "zfs-jail — attach or detach ZFS filesystem from FreeBSD jail".

zfs-project was as well, to a lesser extent, and what triggered Set mode was unclear to me: I assumed it's zfs project -p id with no other flags – is that right?

That's right, The updated page looks good too, a little less wordy in places which is nice.

The one .br subcommand in zfs send --redact redaction_bookmark [-DLPcenpv] [-i snapshot|bookmark] snapshot (here and here): is it just line-broken (which is what I assumed) or is it two commands with the same description?

You got it right. It's just one command.

I skimmed over the rest of the pages and they all looked reasonable to me. Definitely a big step in the right direction, thanks!

Signed-off-by: Ahelenia Ziemiańska <[email protected]>
@nabijaczleweli
Copy link
Contributor Author

Point; added the "Jails are a .Fx feature and are not relevant on other platforms." blurb from zfsprops(8) to the last paragraph after "See .Xr jail 8 for more information on managing jails."

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 3, 2021
@behlendorf
Copy link
Contributor

@nabijaczleweli when testing this on Ubuntu 20.04 I was able to consistently reproduce the following warning. It looks like for newer versions of awk we get this warning because the quote doesn't need to be escaped. If you concur, I'll include this one character change when merging this which fixes the warning.

diff --git a/scripts/mancheck.sh b/scripts/mancheck.sh
index 65f32a78b..a5b8b0d0a 100755
--- a/scripts/mancheck.sh
+++ b/scripts/mancheck.sh
@@ -29,7 +29,7 @@ IFS="
 files="$(find "$@" -type f -name '*[1-9]*' ! -name '*module-param*' ! -name 'zpool>
 
 add_excl="$(awk '
-    /^.\\\" lint-ok:/ {
+    /^.\\" lint-ok:/ {
         print "-e"
         $1 = "mandoc:"
         $2 = FILENAME ":[[:digit:]]+:[[:digit:]]+:"
> make mancheck
./scripts/mancheck.sh ./man ./tests/test-runner/man
awk: cmd. line:2: warning: regexp escape sequence `\"' is not a known regexp operator

@nabijaczleweli
Copy link
Contributor Author

Yeah, that looks good! Thanks for catching this

@behlendorf behlendorf closed this in 4a98300 Jun 4, 2021
behlendorf pushed a commit that referenced this pull request Jun 4, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12129
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12129
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12129
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12129
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 9, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12129
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 9, 2021
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants