Skip to content

chore: roll out ecosystem code-style policy (swift-format + SwiftLint + comment-ratio check) #9

Description

@gsdali

What

Roll out the ecosystem's proposed code-style policy to this repo, the second pilot after
OCCTSwiftScripts (#114 /
#115), replicating that pattern
exactly.

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

This repo's facts

  • ~699 Swift lines across ~6 files: Sources/SwiftJWW/JWW.swift, DXFWriter.swift,
    Reader.swift, Sources/jww2dxf/main.swift, Tests/SwiftJWWTests/SwiftJWWTests.swift. Very
    small: full sweep, trivially so. No exemption manifest needed.
  • Zero first-party C++ bridge files, confirmed. No clang-format needed.
  • Already has 6 mandatory OKF policies onboarded (okf/policies/). This adds a 7th.
  • No existing .github/workflows/ CI today. This bootstraps CI from nothing.

Scope for this repo

  • .swift-format (100 col, 4-space, copied verbatim from OCCTSwiftScripts) plus a full
    swift-format --in-place sweep of Sources/ and Tests/.
  • .swiftlint.yml, scoped to only_rules: [orphaned_doc_comment] (same reasoning as
    OCCTSwiftScripts: SwiftLint's default rule set fights swift-format's formatting opinions and
    overlaps the ecosystem's own code-structure policy on complexity).
  • Scripts/comment-ratio-check.sh: report-only nudge (never fails), bash to match this repo's
    own tooling 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, this repo's 7th mandatory policy.
  • Hand-fix every remaining swift-format lint --strict / swiftlint lint --strict finding after
    the automatic sweep, the same way OCCTSwiftScripts#115 did.

Explicitly out of scope here

  • clang-format: no first-party C++ in this repo.
  • The Swift-symbol docs-drift checks proposed for OCCTSwift in the wider proposal (section 3b):
    not part of this pilot-pattern rollout, same as OCCTSwiftScripts#114's own scoping.

Process

Filed per the ecosystem policy's own gate: no repo implements without a filed issue first. PR to
follow, referencing this issue. Holding for review before merge, not to 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