Documentation Index
Fetch the complete documentation index at: https://docs.tablepro.app/llms.txt
Use this file to discover all available pages before exploring further.
Code Style
Tools
.swiftlint.yml and .swiftformat are the source of truth. When in doubt, check those files.
Formatting
| Rule | Value |
|---|---|
| Indentation | 4 spaces (never tabs) |
| Line length | 120 chars (SwiftLint warns at 180, errors at 300) |
| Braces | K&R (opening brace on same line) |
| Line endings | LF |
| Semicolons | None |
| Trailing commas | None |
Naming
| Element | Convention | Example |
|---|---|---|
| Classes, Structs, Enums, Protocols | UpperCamelCase | DatabaseConnection |
| Enum cases | lowerCamelCase | .postgresql |
| Functions, Variables, Constants | lowerCamelCase | executeQuery(), maxRetryAttempts |
| Booleans | is/has/can prefix | isConnected, hasValidCredentials |
| Factory methods | make prefix | makeConnection() |
| Acronyms | Treat as words | JsonEncoder not JSONEncoder (except SDK types) |
Access Control
Always explicit. Prefer the most restrictive level that works.Imports
System frameworks first (alphabetical), then third-party, then local. Blank line after imports.Safety
No force unwrapping (!) or force casting (as!). Use guard let, if let, as?.
Logging
OSLog only. Neverprint().
Localization
String(localized:)for user-facing strings in computed properties, AppKit code, alerts, error descriptions- SwiftUI view literals (
Text("Save"),Button("Cancel")) auto-localize - Do not localize technical terms: font names, database types, SQL keywords, encoding names
- Never use
String(localized:)with string interpolation. UseString(format: String(localized: "Preview %@"), name)instead.
SwiftUI Patterns
@Statefor local view state@Observablefor viewmodels (Swift 5.9+)- Property wrapper order: Environment, State, Binding, regular properties
- Extract large views into subviews
Limits
| Metric | Warning | Error |
|---|---|---|
| File length | 1200 lines | 1800 lines |
| Type body | 1100 lines | 1500 lines |
| Function body | 160 lines | 250 lines |
| Cyclomatic complexity | 40 | 60 |
MainContentCoordinator.swift
Extensions
MainContentCoordinator+RowOperations.swift
MainContentCoordinator+Pagination.swift
MainContentCoordinator+Filtering.swift
