Thank you for your interest in contributing to Fluxway! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing
- Pull Request Process
- Areas Needing Help
This project follows the Rust Code of Conduct. Please be respectful and constructive in all interactions.
-
Rust toolchain (1.70+)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup component add rustfmt clippy
-
System dependencies (Ubuntu/Debian)
sudo apt install -y \ libudev-dev libwayland-dev libxkbcommon-dev libinput-dev \ libdrm-dev libgbm-dev libegl-dev libgles2-mesa-dev libseat-dev \ libx11-dev libxcb1-dev -
Fork and clone
git clone https://github.com/YOUR_USERNAME/lamella.git cd fluxway
# Debug build (faster compilation)
cargo build
# Release build (optimized)
cargo build --release
# Build with all features
cargo build --all-features
# Build specific features
cargo build --no-default-features --features "wayland"
cargo build --no-default-features --features "x11"# Run in nested mode (inside existing compositor/X11)
cargo run -- --nested
# Run with debug logging
RUST_LOG=debug cargo run -- --nested
# Validate configuration
cargo run -- --validatemain— Stable, release-ready codedevelop— Integration branch for featuresfeature/*— New featuresfix/*— Bug fixesdocs/*— Documentation updates
-
Create a branch from
develop:git checkout develop git pull origin develop git checkout -b feature/my-feature
-
Make your changes with clear, focused commits
-
Ensure all checks pass:
cargo fmt --check cargo clippy --all-features cargo test -
Push and create a pull request
We use rustfmt with the configuration in rustfmt.toml:
# Format all code
cargo fmt
# Check formatting without changes
cargo fmt --checkWe use strict Clippy lints appropriate for window manager development:
# Run Clippy
cargo clippy --all-features
# With all warnings as errors
cargo clippy --all-features -- -D warningsKey linting rules:
- No
.unwrap()or.expect()in non-test code — use proper error handling - No
.ok()silently ignoring errors — handle or log errors - No
panic!()in production code — window managers must not crash - Prefer
.get()over indexing — avoid panics on out-of-bounds
- All public items must have documentation
- Use
///for item documentation - Use
//!for module-level documentation - Include examples where helpful
/// Calculates the layout for all windows in a workspace.
///
/// This function traverses the container tree and assigns geometry
/// to each window based on the current layout mode.
///
/// # Arguments
///
/// * `workspace` - The workspace to calculate layout for
/// * `outer_gap` - Gap between windows and screen edges
///
/// # Returns
///
/// A vector of window IDs with their calculated geometries.
pub fn calculate_layout(workspace: &Workspace, outer_gap: u32) -> Vec<(WindowId, Geometry)> {
// ...
}Use thiserror for error types and anyhow for error propagation:
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("Failed to read config file: {0}")]
ReadError(#[from] std::io::Error),
#[error("Failed to parse config: {0}")]
ParseError(#[from] toml::de::Error),
#[error("Invalid value for {field}: {message}")]
InvalidValue { field: String, message: String },
}Unsafe code requires a // SAFETY: comment explaining why it's safe:
// SAFETY: We've verified that ptr is non-null and properly aligned,
// and the memory it points to is valid for the lifetime of this reference.
unsafe { &*ptr }# Run all tests
cargo test
# Run specific test
cargo test test_layout_calculation
# Run tests with output
cargo test -- --nocapture
# Run tests for specific feature
cargo test --features "x11"Place tests in the same file as the code they test:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_container_split() {
let mut container = Container::new(ContainerType::Split);
container.add_child(child1);
container.add_child(child2);
assert_eq!(container.children().len(), 2);
}
#[test]
fn test_geometry_intersection() {
let a = Geometry::new(0, 0, 100, 100);
let b = Geometry::new(50, 50, 100, 100);
let intersection = a.intersection(&b);
assert!(intersection.is_some());
}
}Place integration tests in tests/:
// tests/ipc_test.rs
use fluxway::ipc::{IpcClient, IpcMessage};
#[test]
fn test_ipc_round_trip() {
// Test IPC message serialization/deserialization
}Add benchmarks to benches/:
// benches/layout_bench.rs
use criterion::{criterion_group, criterion_main, Criterion};
fn layout_benchmark(c: &mut Criterion) {
c.bench_function("calculate_layout_100_windows", |b| {
b.iter(|| {
// Benchmark code
});
});
}
criterion_group!(benches, layout_benchmark);
criterion_main!(benches);-
Rebase on latest develop
git fetch origin git rebase origin/develop
-
Ensure all checks pass
cargo fmt --check cargo clippy --all-features -- -D warnings cargo test -
Update documentation if needed
-
Write a clear PR description
## Description
Brief description of the changes.
## Type of Change
- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to change)
- [ ] Documentation update
## Testing
Describe the tests you ran and how to reproduce.
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have added tests covering my changes
- [ ] All new and existing tests pass
- [ ] I have updated documentation as needed
- [ ] My commits are focused and have clear messages- At least one maintainer must approve
- All CI checks must pass
- No unresolved conversations
- Squash and merge preferred for clean history
- X11 Native Backend: Implementing full X11 window manager support
- DRM Backend: Direct rendering for production use on TTY
- Testing: Real-world testing on various hardware and distros
- Documentation: Improving guides, examples, and API docs
- Accessibility: Screen reader support, high contrast themes
- Packaging: Creating packages for major distributions
Look for issues labeled good first issue:
- Documentation improvements
- Adding tests for existing functionality
- Small bug fixes
- Code cleanup and refactoring
- Plugin/extension system design
- Scripting API (Lua, Rhai, or other)
- Wayland protocol extensions
- Performance optimization
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and general discussion
- Code Review: Ask questions in PR comments
Contributors are recognized in:
- The project's CONTRIBUTORS file
- Release notes for significant contributions
- GitHub's contributor graph
Thank you for contributing to Fluxway! 🎉