Name the documented arguments the way the declarations name them - #3698
Open
karpovantonme wants to merge 1 commit into
Open
Name the documented arguments the way the declarations name them#3698karpovantonme wants to merge 1 commit into
karpovantonme wants to merge 1 commit into
Conversation
Motivation: Eight doc comments name an argument that the declaration below them does not have, so DocC has nothing to bind the description to and drops it. Nothing warns about this: Swift has no equivalent of -Wdocumentation, and DocC stays silent rather than complaining. Three of them are the same defect in two copies of one module, NIOFS and _NIOFileSystem, which is what a verbatim copy of a file does to a mistake in it. Modifications: Renamed the documented argument to the one in the declaration, in eleven places across eight files. In ByteBuffer.write(headers:) the entry described the buffer the method is called on rather than the argument, so it now describes the argument and keeps the note about the writer index. The deprecated init(descriptor:setNonBlocking:) overloads were left alone: their documentation is correct. It is their replacements, init(socket:), that inherited the wording. Result: The parameter descriptions reach the generated documentation. No API change, no behaviour change, comments only.
glbrntt
enabled auto-merge (squash)
August 13, 2026 08:13
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.
Motivation:
Eight doc comments name an argument that the declaration below them does not have, so DocC has nothing to bind the description to and quietly drops it. Nothing warns about this: Swift has no equivalent of
-Wdocumentation, and DocC stays silent rather than complaining, so these sit until somebody reads the generated page and wonders where the description wentNIOPosix/ServerSocket.swiftdescriptorsocketNIOPosix/Socket.swift×2descriptorsocketNIOHTTP1/ByteCollectionUtils.swiftbytestoNIOHTTP1/HTTPTypes.swiftbufferheadersNIOFS/BufferedStream.swift×2sequenceelementNIOFS/SystemFileHandle.swiftexecutorthreadPoolThe socket ones are worth a word. Each of those files has a pair: a deprecated
init(descriptor:)and its replacementinit(socket:), and the rename is recorded right there in@available(*, deprecated, renamed: "init(socket:setNonBlocking:)"). The replacement inherited the wording of the one it replaced, so the doc still saysdescriptor. The deprecated ones are correct and I left them aloneAnd the last two are the same defect in two copies of one module,
NIOFSand_NIOFileSystem, which is what a verbatim copy of a file does to a mistake inside it. Fixing one and not the other would leave them out of sync, so both are in hereModifications:
Renamed the documented argument to the one in the declaration, eleven lines across eight files
One is slightly more than a rename: in
ByteBuffer.write(headers:)the entry described the buffer the method is called on rather than its argument, so it now describesheadersand keeps the note about the writer indexResult:
The parameter descriptions reach the generated documentation. No API change, no behaviour change, comments only
btw these came out of a checker I wrote for exactly this, run over the tree and then read by hand one by one. Six of the things it flagged turned out to be my parser rather than your code, and those are fixed on my side rather than sent to you 🙌🏼
all of it on a MacBook Air M3, of course