First off, thank you for considering contributing to WindowCleaner! 🎉
This document provides guidelines and steps for contributing. Following these guidelines helps communicate that you respect the time of the developers managing and developing this open source project.
- Code of Conduct
- Getting Started
- How Can I Contribute?
- Development Workflow
- Style Guidelines
- Commit Messages
- Pull Request Process
This project and everyone participating in it is governed by our commitment to providing a welcoming and inclusive environment. By participating, you are expected to:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- macOS 15.6+
- Xcode 26+
- Homebrew (for SwiftFormat and SwiftLint CLI)
-
Fork the repository on GitHub
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/WindowCleaner.git cd WindowCleaner -
Run the setup script
make setup
This installs SwiftFormat, SwiftLint, and configures git hooks.
-
Open in Xcode
make open # or open WindowCleaner.xcodeproj -
Build and run to verify everything works (
⌘R)
Before creating bug reports, please check existing issues to avoid duplicates.
When creating a bug report, include:
- Clear title describing the issue
- Steps to reproduce the behavior
- Expected behavior vs actual behavior
- Screenshots if applicable
- Environment details: macOS version, Xcode version, Swift version
Use this template:
**Describe the bug**
A clear description of what the bug is.
**To Reproduce**
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What you expected to happen.
**Screenshots**
If applicable, add screenshots.
**Environment**
- macOS: [e.g., 15.6]
- Xcode: [e.g., 26.0]
- Swift: [e.g., 6.0]Enhancement suggestions are welcome! Please include:
- Clear title describing the enhancement
- Detailed description of the proposed functionality
- Use case explaining why this would be useful
- Possible implementation if you have ideas
We love pull requests! Here's how to submit one:
- Fork the repo and create your branch from
main - Make your changes
- Ensure code passes linting and formatting
- Write or update tests if applicable
- Update documentation if needed
- Submit the pull request
# For features
git checkout -b feature/your-feature-name
# For bug fixes
git checkout -b fix/issue-description
# For documentation
git checkout -b docs/what-you-documented- Write clean, readable code
- Follow the Style Guidelines
- Add comments for complex logic
- Update documentation as needed
# Format code
make format
# Run linter
make lint
# Or run both
make all# Run all tests
make test
# Build to check for compile errors
make buildFollow the Commit Message Guidelines.
git add .
git commit -m "feat: add new feature description"git push origin your-branch-nameThen open a Pull Request on GitHub.
This project uses SwiftLint and SwiftFormat to enforce consistent code style.
- Indentation: 4 spaces (no tabs)
- Line length: 120 characters max (warning), 200 (error)
- Imports: Sorted alphabetically
- Self: Omit
self.when not required - Trailing commas: Always include in multi-line collections
Use // MARK: - comments to organize code:
struct MyView: View {
// MARK: - Environment
@Environment(\.modelContext) private var modelContext
// MARK: - State
@State private var isLoading = false
// MARK: - Body
var body: some View {
// ...
}
// MARK: - Actions
private func performAction() {
// ...
}
}- Types:
PascalCase(e.g.,ItemDetailView,DataService) - Functions/Variables:
camelCase(e.g.,fetchItems(),selectedItem) - Constants:
camelCasein enums (e.g.,Metrics.spacing)
- Include
#Previewfor all views - Use
@ViewBuilderfor conditional content - Extract complex views into separate components
- Use
@Modelmacro - Include documentation comments
- Provide sample data for previews
- Use Swift documentation comments (
///) for public APIs - Keep README and other docs up to date
- Include code examples where helpful
We follow Conventional Commits for clear, consistent commit history.
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
style |
Formatting, no code change |
refactor |
Code change that neither fixes a bug nor adds a feature |
perf |
Performance improvement |
test |
Adding or updating tests |
chore |
Maintenance tasks |
# Feature
git commit -m "feat(views): add dark mode support to SettingsView"
# Bug fix
git commit -m "fix(data): resolve crash when deleting last item"
# Documentation
git commit -m "docs: update README with new setup instructions"
# Refactor
git commit -m "refactor(models): extract validation logic to separate service"- Code compiles without errors
- All tests pass (
make test) - Code is formatted (
make format) - Linter passes (
make lint) - Documentation is updated (if applicable)
- Commit messages follow conventions
Use the same format as commit messages:
feat(scope): description of the change
Include:
- What does this PR do?
- Why is this change needed?
- How was it implemented?
- Screenshots (for UI changes)
- Testing done
- A maintainer will review your PR
- Address any requested changes
- Once approved, a maintainer will merge the PR
- Delete your feature branch
- Pull the latest
mainto your local repo - Celebrate! 🎉
If you have questions, feel free to:
- Open a GitHub Issue
- Start a Discussion
Thank you for contributing! ❤️