Docs/Contributing/Code Style

Code Style

Formatting, linting, and commit conventions.

Formatting

Rust

just fmt          # format all Rust code
just fmt-check    # check without modifying (CI uses this)

Config in rustfmt.toml:

edition = "2024"

All other settings are rustfmt defaults (4-space indent, 100-char lines).

Swift

just fmt-swift    # format all Swift code

Config in .swift-format:

SettingValue
Indentation4 spaces
Line length120 characters
Respects existing line breaksyes
Max consecutive blank lines1

Disabled lint rules: AllPublicDeclarationsHaveDocumentation, NeverForceUnwrap, NeverUseForceTry, NeverUseImplicitlyUnwrappedOptionals, AlwaysUseLiteralForEmptyCollectionInit.

Editor config

.editorconfig applies to all editors:

File typeIndentNotes
*.rs4 spaces
*.swift4 spaces
*.yml, *.yaml, *.toml2 spaces
All filesLF line endings, final newline, trim trailing whitespace, UTF-8

Linting

Clippy

just lint         # clippy with warnings as errors

Runs cargo clippy --all-targets with RUSTFLAGS="-D warnings". All warnings are errors in CI.

Config in clippy.toml:

msrv = "1.88"

Dependency audit

just deny         # check licenses, advisories, bans, sources

Config in deny.toml. Allowed licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, BSL-1.0, ISC, Unicode-3.0, Unlicense, Zlib. Unknown registries and git sources are denied.

Git hooks

Installed by just setup. Located in .githooks/.

Pre-commit

Three checks, each skippable individually:

CheckWhat it doesSkip with
rust-fmtcargo fmt --all -- --checkSKIP_HOOKS=rust-fmt
swift-fmtswift-format lint --strict on staged .swift filesSKIP_HOOKS=swift-fmt
hygieneBlocks files >1MB, merge conflict markers, secret patternsSKIP_HOOKS=hygiene

Secret patterns detected: AWS keys, private keys (RSA/EC/DSA/OpenSSH), GitHub tokens, Slack tokens, generic API keys, password/api_key assignments.

Skip all checks: SKIP_HOOKS=all git commit ...

Commit message

Format: type[(scope)]: Description starting with capital

RuleValue
Typesfeat, fix, chore, docs, refactor, test, ci, perf, style, build
Max length72 characters
CaseSentence case (first letter uppercase)
Trailing periodNot allowed
ScopeOptional, alphanumeric + underscore + hyphen

Examples:

feat: Add workspace pulse command
fix(cli): Resolve manifest parsing error
docs: Update CLI reference with missing commands

Exceptions: merge commits, revert commits, fixup/squash commits.

Branch naming

Use pu/{name} for PurePoint branches.

CI pipeline

just ci-rust runs the full Rust check suite: fmt-check + lint + test + deny.

just ci adds: build-app + test-app.

Both match what runs in GitHub Actions (.github/workflows/).