chore(#12): roll out the ecosystem code-style policy - #13
Merged
Conversation
Full sweep, not a gradual manifest: this repo is small enough (~547 Swift lines across 4 files) to fully sweep into compliance in one PR, same as OCCTSwiftScripts#115. Adds: - .swift-format (100 col, 4-space) + a full swift-format --in-place sweep of Sources/ + Tests/. - .swiftlint.yml, scoped to only_rules: [orphaned_doc_comment]. - Scripts/comment-ratio-check.sh: report-only nudge (never fails). - .github/workflows/code-style.yml: swift-format lint --strict and swiftlint lint --strict as blocking gates, comment-ratio as a non-blocking step. - okf/policies/code-style.md, linked from okf/index.md. - Hand fixes for every lint finding swift-format --in-place could not auto-fix: BeginDocumentationCommentWithOneLineSummary (blank /// line after the one-line summary, 15 doc comments across both source files), AlwaysUseLowerCamelCase (3 local renames in HoleFill.swift's liepaFill: P -> points, INF -> inf, Wt -> weightTable; local-only, all call sites updated), EndOfLineComment (1 comment moved to its own line in the test file). - Em-dashes removed from every line touched in Sources/ (writing-style policy), replaced with plain punctuation. Zero behavior change: swift build / swift test verified before and after, identical result (build succeeds, 7/7 tests pass). swift-format lint --strict and swiftlint lint --strict both report zero violations. Closes #12 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Roll out the ecosystem's code-style policy to this repo
(
ecosystemdocs/code-style-policy-proposal-2026-08.md),following the reference implementation
(OCCTSwiftScripts#114 /
OCCTSwiftScripts#115). This repo is
tiny (~547 Swift lines across 4 files:
Sources/SwiftMeshHeal/MeshHeal.swift,Sources/SwiftMeshHeal/HoleFill.swift,Tests/SwiftMeshHealTests/MeshHealTests.swift), so this isa full sweep, not a gradual exemption-manifest rollout, straight to a blocking gate.
Adds:
.swift-format(100 col, 4-space, the ecosystem's one deliberate divergence from Google's2-space default) copied verbatim from OCCTSwiftScripts, plus a full
swift-format --in-place --recursivesweep ofSources/+Tests/..swiftlint.yml, deliberately narrow (only_rules: [orphaned_doc_comment]). SwiftLint's defaultrule set duplicates
swift-format's formatting opinions (can disagree with them on the sameline) and separately opens a large code-quality/complexity surface (
identifier_name,cyclomatic_complexity,function_body_length,nesting, ...) that overlaps the ecosystem's owncode-structurepolicy rather than this one. Scoped down to the one rule that catches somethingswift-formathas no equivalent for.Scripts/comment-ratio-check.sh: report-only nudge (never fails), bash to match this repo's ownscript convention (not the Python style
OCCTSwift/Scripts/uses)..github/workflows/code-style.yml:swift-format lint --strictandswiftlint lint --strictasblocking gates, comment-ratio as a non-blocking step. Pure text analysis, no
swift buildneededin the gate itself.
okf/policies/code-style.md: linked fromokf/index.md.swift-format --in-placecould not auto-fix:BeginDocumentationCommentWithOneLineSummary(15 doc comments acrossMeshHeal.swiftandHoleFill.swift): inserted a blank///line after the one-line summary sentence, moving therest of the existing prose into a second paragraph. No content removed.
AlwaysUseLowerCamelCase(3 local renames, all insideHoleFill.swift'sliepaFill, allcall sites updated in the same function):
P->points,INF->inf,Wt->weightTable.Local-only, no public API surface touched.
EndOfLineComment(1 finding,Tests/SwiftMeshHealTests/MeshHealTests.swift): moved atrailing comment that exceeded the line length onto its own line above the statement.
(colon, comma, or a second sentence), per the ecosystem's writing-style policy, since these are
files this PR edits directly.
Explicitly out of scope (see #12):
clang-format(zero first-party C++ bridge files in this repo, confirmed), and any new docs-drifttooling beyond what this repo's existing
docs-current/context-firstpolicies already cover.Zero behavior change. Renames are local-only; everything else is formatting/doc-comment
restructuring plus the
publicaccess modifier moving from theextensiondeclaration to eachmember (swift-format's
NoAccessLevelOnExtensionDeclarationrule), which does not change thepublic API surface. Verified directly, not just asserted:
swift buildandswift test: identical result before and after this sweep (build succeeds,7/7 tests pass).
swift-format lint --strictandswiftlint lint --strict: both report zero violations.Scripts/comment-ratio-check.sh: no files at or above the 1.0x threshold.Package.resolvedwas created or touched (this package has no external dependencies).Checklist
verification); see SecondMouseAU/OCCTReconstruct#397
for the ecosystem-wide test-coverage standard this is piloting.
N/A here: no behavior changed (formatting/docs/CI only), verified via the existing
MeshHealTestssuite (7/7 passing, identical before and after) rather than new tests, sincethere is no new behavior for a new test to cover.
Notes for the reviewer
Per the ecosystem's own gate (no repo implements without a filed issue first), this was filed as
#12 before any of this landed. Holding
for review before merge.
Closes #12
🤖 Generated with Claude Code