Contributing to Fast Craftsmanship¶
Thank you for your interest in contributing to Fast Craftsmanship! This guide will help you set up your development environment and understand our contribution workflow.
Development Setup¶
Prerequisites¶
- Python 3.12 or higher
- Git
- uv (recommended for dependency management)
Clone the Repository¶
Install Development Dependencies¶
This installs the package in development mode with all required development dependencies.
Development Workflow¶
Code Style¶
Fast Craftsmanship follows these code style principles:
- Railway Oriented Programming (ROP) using the Expression library
- Pydantic models for data validation
- Functional programming paradigms
Key guidelines:
- Use
Resulttypes for error handling (avoid try/except) - Prefer composable functions over classes where possible
- Use immutable data structures
- Make all functions type-annotated
- Use generator-based functions with
yield fromfor sequencing operations
Running Tests¶
# Run all tests
pytest tests/
# Run specific tests
pytest tests/commands/test_github.py
# Run tests with coverage
pytest --cov=fcship tests/
Linting¶
We use Ruff for linting and formatting:
Git Workflow¶
Branch Naming¶
feat-*: New featuresfix-*: Bug fixesrefactor-*: Code refactoringdocs-*: Documentation changestest-*: Adding or modifying tests
Commit Messages¶
We follow the conventional commits specification:
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- refactor: Code refactoring
- test: Adding or modifying tests
- chore: Maintenance tasks
Example:
feat: add new GitHub workflow commands
Adds new commands for listing, viewing, and watching GitHub workflow runs.
The commands use the GitHub API via pygithub to retrieve workflow information.
Closes #42
Pull Requests¶
- Create a new branch from
mainfor your changes - Make your changes following our code style guidelines
- Write tests for new functionality
- Make sure all tests pass
- Submit a pull request to the
mainbranch - Wait for review and address any feedback
Documentation¶
We use MkDocs with the Material theme for documentation. Documentation files are in the docs/ directory.
Running Documentation Locally¶
# Install documentation dependencies
uv pip install mkdocs mkdocs-material mkdocstrings-python
# Serve documentation locally
mkdocs serve
Adding Documentation¶
- Add code docstrings following Google style
- Update markdown files in the
docs/directory - Add new pages to the navigation in
mkdocs.yml
Creating New Commands¶
- Create a new file in the appropriate directory under
fcship/commands/ - Use the Result type for error handling
- Add command registration in the appropriate
__init__.pyfile - Add tests in the
tests/commands/directory - Add documentation in the
docs/commands/directory
Release Process¶
Fast Craftsmanship uses automated releases via GitHub Actions:
- Commits to
mainrun CI checks - Version tags (v*) trigger the release workflow
- The release workflow builds and publishes to PyPI
Getting Help¶
If you need help with contributing, feel free to:
- Open an issue on GitHub
- Ask questions in pull requests
- Reach out to the maintainers
We appreciate your contributions and look forward to your ideas!