Getting Started
Set up development environment
Project Guidelines
Code Style
CodexBar enforces consistent formatting with SwiftFormat and SwiftLint:- 4-space indentation (not tabs)
- 120-character line limit
- Explicit
selfis intentional - do not remove - Maintain existing
// MARK:section organization - Use descriptive variable/function names
Testing Requirements
All code changes must include tests:- Add test cases to
Tests/CodexBarTests/for new features - Use the pattern
FeatureNameTests.swiftwithtest_caseDescriptionmethod names - Run tests before committing:
swift test - Add fixtures for new parsing/formatting scenarios
Commit Guidelines
Write clear, concise commit messages:- Use imperative mood: “Add feature” not “Added feature”
- Keep the first line under 72 characters
- Focus on why rather than what
- Reference issues when relevant: “Fix icon dimming (#123)”
Module Organization
CodexBar is organized into focused modules. Keep changes scoped appropriately:- CodexBarCore: Fetching, parsing, provider logic
- CodexBar: State management, UI, menu bar integration
- CodexBarCLI: Command-line interface
- Scripts/: Build and release automation
- docs/: Project documentation
CodexBar, not CodexBarCore.
Development Workflow
Making Changes
Write code
Make your changes following the code style guidelines. Keep changes focused and scoped to a single feature or fix.
After Code Changes
Important: Always rebuild and relaunch after editing code:- Old processes are killed (prevents stale binaries)
- Fresh build is packaged
- App relaunches with your changes
- Crashes are caught immediately
Pull Request Process
Before Submitting
Pre-submission checklist
Pre-submission checklist
- All tests pass:
swift test - Code is formatted:
swiftformat Sources Tests - No lint issues:
swiftlint --strict - App builds and runs:
./Scripts/compile_and_run.sh - Manual testing completed for your changes
- Commit messages are clear and descriptive
- Changes are scoped to a single feature/fix
Submitting Your PR
Create pull request
Open a PR on GitHub with:
- Clear title describing the change
- Summary of what changed and why
- Testing details: commands run, manual tests performed
- Screenshots/GIFs for UI changes
- Related issue link if applicable
PR Template
Provider Development
Adding a new provider? Follow these guidelines:- Read the provider authoring guide: docs/provider.md
- Implement the provider protocol: Create fetcher, parser, and store integration
- Add provider icon: Place in
Sources/CodexBar/Resources/ - Test thoroughly: Add test cases for parsing and error handling
- Document authentication: Explain how users configure credentials
Sources/CodexBarCore/ for reference implementations.
Swift 6 Concurrency
CodexBar uses Swift 6 strict concurrency. Follow these patterns:Concurrency Rules
- Use
Sendablefor types crossing isolation boundaries - Avoid
@unchecked Sendableunless absolutely necessary - Prefer
async/awaitover completion handlers - Run background work off the main actor
- Use
@MainActorfor all UI updates
Code Review Standards
Reviewers look for:- Correctness: Does it solve the problem?
- Testing: Are tests comprehensive?
- Style: Does it follow project conventions?
- Performance: Are there any bottlenecks?
- Concurrency: Is it Sendable-safe?
- Scope: Is the change focused and minimal?
Release Process
Contributors don’t need to handle releases, but for context:- Releases use
Scripts/release.shfor end-to-end automation - Binaries are notarized via App Store Connect API
- Updates are distributed via Sparkle and Homebrew
- See RELEASING.md for the full process
Getting Help
- Issues: Report bugs or request features on GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Architecture: Read Architecture for module structure
- Building: See Building from Source for dev setup
