Skip to content

Roll out ecosystem code-style policy (swift-format + SwiftLint + comment-ratio nudge) #12

Description

@gsdali

What

Roll out the ecosystem's proposed code-style policy to this repo: swift-format +
SwiftLint (scoped to orphaned_doc_comment) as blocking CI, plus a non-blocking
comment:code ratio nudge script.

Proposal doc: ecosystem docs/code-style-policy-proposal-2026-08.md

Precedent: OCCTSwiftScripts#114 /
OCCTSwiftScripts#115, the reference
implementation for a repo this size.

Scope for this repo

This codebase is tiny (~547 Swift lines across 4 files: Sources/SwiftMeshHeal/MeshHeal.swift,
Sources/SwiftMeshHeal/HoleFill.swift, Tests/SwiftMeshHealTests/MeshHealTests.swift), so this
is a full sweep, not a gradual exemption-manifest rollout the way OCCTSwift needs at its
size:

  • .swift-format (100 col, 4-space, copied verbatim from OCCTSwiftScripts' config) +
    a full swift-format --in-place --recursive sweep of Sources/ + Tests/.
  • .swiftlint.yml, scoped to only_rules: [orphaned_doc_comment]: SwiftLint's default rule set
    duplicates swift-format's formatting opinions and separately opens a code-quality/complexity
    surface that overlaps the ecosystem's own code-structure policy rather than this one.
  • Scripts/comment-ratio-check.sh: report-only nudge (never fails), bash to match this repo's
    own convention.
  • .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-fix every remaining swift-format lint --strict / swiftlint lint --strict finding that
    --in-place can't auto-fix (doc-comment structure, orphaned doc comments, etc.) until both
    tools report zero violations.

Explicitly out of scope here

  • clang-format: zero first-party C++ bridge files in this repo (confirmed).
  • Any docs-drift checks beyond what's already covered by this repo's existing
    docs-current/context-first policies: this repo's docs/reference/MeshHeal.md isn't the
    CLI-verb-table shape those checks target elsewhere in the ecosystem.

Process

Filed per the ecosystem policy's own gate: no repo implements without a filed issue first. PR to
follow, referencing this issue. Zero behavior change: swift build/swift test verified
before and after. Holding for review before merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions