style(#942): fix Shape+Modeling.swift's 32 swift-format doc-comment violations, unblocking main's code-style - #945
Merged
Conversation
…ng.swift PR #940 removed this file from Scripts/style-manifest-swift.txt after running the formatter, but the formatter does not fix documentation-comment rules, so main has been red on code-style since it merged. `swift-format lint --strict` reports 32 violations on the file at origin/main, not the 24 the issue counted. BeginDocumentationCommentWithOneLineSummary (27): a missing terminating period, or a summary paragraph holding more than one sentence, which needs a blank comment line after the first. ValidateDocumentationComments (5): the advanced `wedge` documented its seven parameters as two grouped entries; `localLinearForm` documented `from`/`to`, the argument labels, where the rule matches the parameters' own names `start`/`end`; `wedge(at:direction:...)`, `buildWires` and `splitByWireOnFace` had no `Returns:`. The advanced wedge's per-parameter text comes from OCCT's own header, which documents the constructor as "Make a wedge. The face at dy is xmin,zmin xmax,zmax", not from invention. The issue reads two sites (the `splitWithFullHistory` and `GlueMode.asBooleanGlue` summaries) as having had their symbol references erased. They had not: swift-format strips inline code spans and doc links when it renders a diagnostic message, so the gaps are in the message, not the source. Both are ordinary two-sentence summaries. Three em-dashes are gone from the doc comments this touches, per okf/policies/writing-style.md. Doc comments only: no logic, signature or call site changes, so every changed line is a `///` line. Closes #942 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 203.8K · Output: 3.9K · Cached: 803.7K |
This was referenced Aug 18, 2026
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.
What & why
mainhas been red oncode-stylesince PR #940, which removedSources/OCCTSwift/Shape+Modeling.swiftfromScripts/style-manifest-swift.txtafter running theformatter. The formatter does not touch documentation-comment rules, so the file left the
manifest still failing the linter, and every push to
mainsince has failed the job. Thisfixes the doc comments, which is the only route: the manifest is a ratchet, and
check-style-manifest.pycorrectly refuses to have the file added back.Measured at
origin/main,swift-format lint --strict --configuration .swift-formatreports 32violations on the file, not the 24 the issue counted. The extra eight are the same two rules and the
same shapes; the issue's tables list a subset with "examples". After this PR the file reports zero,
and so does the whole non-manifest set that CI lints.
BeginDocumentationCommentWithOneLineSummary(27). Either a summary with no terminating period,or a summary paragraph holding more than one sentence, which the rule wants split with a blank
comment line after the first. No wording was dropped; the second sentence onward moved into its own
paragraph and was rewrapped to the 100-column limit.
ValidateDocumentationComments(5).wedge(dx:dy:dz:xmin:zmin:xmax:zmax:)- dx, dy, dz:and- xmin, zmin, xmax, zmax:), which matches no parameterwedge(at:direction:dx:dy:dz:ltx:)Returns:A wedge solid, or nil on failure.localLinearForm(direction:from:to:)from/to, the argument labels; the rule matches the parameters' own namesstart/end, each noting the label it is passed underbuildWires(faceIndex:)Returns:The wires built from those edges, or nil on failure.splitByWireOnFace(_:faceIndex:)Returns:The shape with that face split by the wire, or nil on failure.The advanced wedge's per-parameter text is taken from OCCT's own header, which documents that
constructor as "Make a wedge. The face at dy is xmin,zmin xmax,zmax"
(
BRepPrimAPI_MakeWedge.hxx), rather than invented to satisfy the linter. ThatlocalLinearFormwants the internal names was measured, not assumed: a two-function probe under this repo's
.swift-formatflags the label-documented version and passes the name-documented one.The two sites the issue reads as damaged
The issue reads line 1255 (
splitWithFullHistory) and line 3326 (GlueMode.asBooleanGlue) ashaving had their symbol references erased, leaving text that says nothing. The source was never
damaged.
swift-formatstrips inline code spans and doc links when it renders a diagnosticmessage, so
`self`,`tool`,``Shape/BooleanGlue``,`internal`and the rest comeout as empty gaps in the message text. The gaps are in the diagnostic, not in the file. At
origin/mainthe two sites read, in full:Both are ordinary multi-sentence summaries and got the ordinary fix: a blank comment line after the
first sentence. Nothing was reconstructed and no reference was invented, so
git log -Sarchaeologywas not needed. Worth recording, because the same misreading is available to anyone reading a
future
swift-formatmessage: the rule quotes plain text, so any summary built around a symbolreference will look gutted in the diagnostic.
CHANGELOG entry
None. Documentation-comment wording and layout only, with no observable change to the API, its
behaviour, or its published reference docs. The user-visible effect is that
main'scode-stylejob goes green again.
SemVer impact
NONE. Doc comments only: no declaration, signature, default value or behaviour changes, so a
consumer's build is bit-identical. Nothing to migrate.
Checklist
verification). No behaviour changed, so no test is added. The detector for this change is
swift-format lint --strictitself, and it is run by CI on every push.--self-testcase was run once with its subject broken, and thefailure is reported here. No new test or self-test. The equivalent evidence is that the check
was watched failing before the fix and passing after: 32 errors at
origin/main, 0 after,with the full before-list captured while working.
docs/CHANGELOG.mdis not in this diff.docs/SEMVER.mdis not in this diff.Notes for the reviewer
Scope, deliberately narrow. Every changed line is a
///line:git diff -U0 | grep '^[+-]' | grep -v '^[+-] *///'returns nothing. No logic, signature or callsite was touched, and no
.mmfile was touched, so this should auto-merge with PR #944 (which edits.boundscall sites in the same file) and with #794's bridge work.Scripts/style-manifest-swift.txtis untouched. The file is already off it, and perokf/policies/code-style.mda file that has left the manifest complies rather than beingre-listed.
Em-dashes: three cleared, 47 left.
okf/policies/writing-style.mdasks that em-dashes becleared from a file being edited. The three inside doc comments this PR rewrites are gone
(
helicalSweep,solidWithFullHistory,GlueMode.asBooleanGlue). The other 47 sit in doc blocksthis PR has no other reason to open; sweeping them would multiply a doc-comment diff that is
deliberately kept narrow to auto-merge with #944, and it would not change what
code-stylereports,since
swift-formathas no opinion on em-dashes. Left for a dedicated pass.Verification, all local, all from the repo root:
swift-format lint --stricton the fileswift-format lint --strictover every non-manifestSources/OCCTSwiftfileswiftlint lint --strict --config .swiftlint.ymlcheck-style-manifest.py --self-test/--base origin/maincomment-ratio-check.py --self-test/ baregate-scriptsinvocations fromci.ymlswift build(OCCTSWIFT_LOCAL=1, local kernel)