Contributing to Ports
January 20, 2026 · View on GitHub
Thank you for your interest in contributing to Ports! This document provides guidelines and information for contributors.
Getting Started
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/Ports.git cd Ports - Build and run:
swift build && swift run PortViewer
Development Guidelines
Code Style
We follow the CorvidLabs Swift Conventions:
- Explicit access control - Always specify
public,internal, orprivate - K&R brace style - Opening brace on same line
- No force unwraps - Never use
!,try!, oras! - async/await only - No completion handlers
- 4-space indentation - No tabs
- 120 character line limit
Commit Messages
Use clear, descriptive commit messages:
Add: new feature description
Fix: bug description
Update: existing feature changes
Remove: deleted functionality
Refactor: code restructuring
Docs: documentation changes
Pull Request Process
-
Create a feature branch from
main:git checkout -b feature/your-feature-name -
Make your changes and ensure:
- Code builds without warnings
- No force unwraps or force try
- Follows existing code patterns
-
Commit your changes with clear messages
-
Push to your fork and create a Pull Request
-
Fill out the PR template with:
- Summary of changes
- Testing performed
- Screenshots (if UI changes)
PR Template
## Summary
- Brief description of changes
## Changes
- List of specific changes made
## Testing
- [ ] Built successfully
- [ ] Tested on macOS 13+
- [ ] UI changes verified
## Screenshots
(If applicable)
Project Structure
Sources/PortViewer/
├── App.swift # App entry, AppState
├── Models/
│ └── PortInfo.swift # Data model
├── Services/
│ ├── PortScanner.swift # Port scanning
│ ├── ProcessKiller.swift # Process termination
│ ├── UpdateChecker.swift # Update checking
│ └── LaunchAtLogin.swift # Login item
└── Views/
├── MenuBarView.swift # Main view
├── PortDetailView.swift
├── SettingsView.swift
└── AboutView.swift
Adding Features
New Port Categories
Edit Sources/PortViewer/Models/PortInfo.swift:
- Add to the
Categoryenum - Update
iconcomputed property - Update
sortOrderproperty - Update the category detection in
categorycomputed property
New Services
Create a new file in Sources/PortViewer/Services/:
- Use
actorfor shared state - Make it
Sendable - Use async/await patterns
- Add to
AppStateif needed
Reporting Issues
When reporting issues, please include:
- macOS version
- App version
- Steps to reproduce
- Expected vs actual behavior
- Any error messages
Questions?
Open an issue with the question label or start a discussion.
Thank you for contributing!