Skip to main content

Tools

Rockxy enforces code style with two tools. Configuration lives in the repository root:
  • SwiftLint.swiftlint.yml — linting rules and complexity limits
  • SwiftFormat.swiftformat — automatic formatting

Formatting

Import Order

System frameworks first (alphabetically), then third-party packages, then local modules. Separate groups with a blank line:

Access Control

Always specify access control explicitly — on the extension when all members share the same level, on individual members otherwise:

Optionals

No force unwrapping (!) or force casting (as!) anywhere in the codebase. Use safe alternatives:

Logging

Use OSLog through the Logger API. Every type that logs should declare a static logger:
Never use print() in production code. All logging must go through OSLog so it appears in Console.app and can be filtered by subsystem and category.

Localization

Use String(localized:) for all user-facing strings in non-SwiftUI code:
SwiftUI view literals auto-localize — Text("Start Proxy") and Button("Clear Session") are automatically looked up in the strings catalog. Do not wrap these in String(localized:). Do not localize technical terms (HTTP, TLS, WebSocket, GraphQL, etc.).

Naming Conventions

Comments

Do not add comments that restate what the code already says. Only comment to explain non-obvious reasoning:

SwiftLint Limits

When approaching these limits, extract logic into extension files following the MainContentCoordinator pattern — e.g., TypeName+Category.swift. Group by domain logic, not arbitrary line counts.

Commits

Follow Conventional Commits. Single line, no description body:
Common prefixes: feat, fix, refactor, docs, test, chore, perf.

Branch Naming

Create branches from main with a prefix matching the work type:

Next Steps

Architecture

Understand the actor model, coordinator pattern, and data flow

Building

Build from source, run tests, and lint your changes