Contributing
Thank you for your interest in contributing to SamWM! This guide explains how to contribute effectively.
Getting Started
Prerequisites
- Go 1.22 or later
- Git
- Linux with Wayland support (for testing)
Setup Development Environment
# Fork and clone
git clone https://github.com/YOUR_USERNAME/samwm.git
cd samwm
# Add upstream remote
git remote add upstream https://github.com/samouly/samwm.git
# Install dependencies
go mod downloadHow to Contribute
Reporting Bugs
- Check existing issues to avoid duplicates
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- System information (OS, Go version)
- Relevant logs or screenshots
Suggesting Features
- Check existing feature requests
- Create a new issue with:
- Clear description of the feature
- Use cases and motivation
- Proposed implementation (if applicable)
- Potential impact on existing features
Submitting Code
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Add tests for new functionality
- Update documentation if needed
- Commit with clear messages:
git commit -m "feat: add my feature" - Push to your fork:
git push origin feature/my-feature - Create a pull request
Development Guidelines
Code Style
- Follow Effective Go
- Use
gofmtandgoimports - Write clear, self-documenting code
- Add comments for complex logic
Commit Messages
Use conventional commits:
<type>(<scope>): <description>
[optional body]
[optional footer]Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(layout): add grid layout algorithm
fix(input): resolve keybinding conflict with shift modifier
docs(config): update keybinding documentationTesting
- Write tests for all new functionality
- Maintain or improve test coverage
- Use table-driven tests where appropriate
- Test edge cases and error conditions
# Run all tests
make test
# Run with coverage
go test -coverprofile=coverage.out ./...
# Run specific tests
go test ./internal/config/...Documentation
- Update README.md for user-facing changes
- Update docs/ for technical changes
- Add doc comments for new exported functions
- Include examples for new features
Pull Request Process
Before Submitting
-
Test your changes:
make test make lint make fmt -
Update documentation if needed
-
Rebase on latest main:
git fetch upstream git rebase upstream/main
PR Description
Include in your PR description:
- What changes were made
- Why the changes were made
- How to test the changes
- Related issues (if any)
Review Process
- Maintainers will review your PR
- Address any feedback
- PR will be merged once approved
Code Review Guidelines
For Authors
- Keep PRs focused and small
- Write clear commit messages
- Respond to feedback promptly
- Be open to suggestions
For Reviewers
- Be constructive and respectful
- Focus on code quality and correctness
- Test the changes locally if possible
- Approve when ready
Community Guidelines
Be Respectful
- Treat everyone with respect
- Be constructive in feedback
- Welcome newcomers
- Be patient with questions
Be Constructive
- Focus on the code, not the person
- Provide actionable feedback
- Suggest improvements, not just problems
- Acknowledge good work
Development Workflow
Feature Development
-
Plan the feature:
- Understand requirements
- Design the solution
- Identify affected areas
-
Implement the feature:
- Write code
- Add tests
- Update documentation
-
Test the feature:
- Run all tests
- Test manually if needed
- Check edge cases
-
Submit the feature:
- Create PR
- Address feedback
- Merge when approved
Bug Fixing
-
Reproduce the bug:
- Understand the issue
- Create a test case
- Verify the fix
-
Fix the bug:
- Implement the fix
- Add regression tests
- Update documentation
-
Verify the fix:
- Run all tests
- Test the specific scenario
- Check for side effects
Release Process
Versioning
SamWM follows Semantic Versioning:
- Major: Breaking changes
- Minor: New features (backward compatible)
- Patch: Bug fixes (backward compatible)
Changelog
Update CHANGELOG.md with:
- New features
- Bug fixes
- Breaking changes
- Deprecations
Getting Help
Resources
Questions
- Check documentation first
- Search existing issues
- Ask in discussions
- Be specific and provide context
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Recognition
Contributors will be recognized in:
- CONTRIBUTORS.md
- Release notes
- Project documentation
Thank you for contributing to SamWM!