Thank you for your interest in contributing to the Boilerplates project! This document provides guidelines and instructions for contributing.
- Code of Conduct
- How to Contribute
- CLI Development
- Template Contributions
- Development Setup
- Code Standards
- Testing Guidelines
- Pull Request Process
Be respectful and constructive in all interactions. We're here to build great tools together.
IMPORTANT: Any changes to the CLI application (cli/ directory) require coordination.
Before making CLI changes:
- Join the Discord server
- Reach out to discuss your proposed changes
- Wait for approval before opening a PR
Rationale: The CLI architecture is complex and tightly integrated. Coordinating changes ensures consistency and prevents conflicts.
Template contributions are welcome and encouraged! You can:
- Add new templates to
library/ - Improve existing templates
- Fix bugs in templates
- Update template documentation
Process:
- Read the Developer Documentation in the Wiki
- Create a new branch:
feature/###-template-nameorproblem/###-fix-description - Add or modify templates following the structure in
library/ - Test your template thoroughly
- Open a pull request
No prior approval needed for template contributions, but feel free to open an issue first to discuss larger changes.
- Python 3.10 or higher
- Git
- pipx (recommended) or pip
- Clone the repository:
git clone https://github.com/ChristianLempa/boilerplates.git
cd boilerplates- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -e .- Run the CLI in development mode:
python3 -m cli --help# Run CLI with debug logging
python3 -m cli --log-level DEBUG compose list
# Test template generation
python3 -m cli compose generate template-name --dry-run
# Validate templates
python3 -m cli compose validate- Follow PEP 8 conventions
- Use 2-space indentation (project standard)
- Maximum line length: 100 characters
- Use type hints where appropriate
- Files: lowercase with underscores (
variable_display.py) - Classes: PascalCase (
VariableCollection,DisplayManager) - Functions/Methods: snake_case (
render_template,get_spec) - Constants: UPPER_SNAKE_CASE (
DEFAULT_TIMEOUT,MAX_RETRIES) - Private methods: prefix with underscore (
_parse_section)
Use standardized comment anchors for important notes:
# TODO: Implement feature X
# FIXME: Bug in validation logic
# NOTE: This is a workaround for issue #123
# LINK: https://docs.python.org/3/library/typing.htmlCRITICAL RULE:
- NEVER use
console.print()outside of display manager classes - NEVER import
Consolefromrich.consoleexcept in display manager classes - ALWAYS use
display.display_*()methods for ALL output
# GOOD
display = DisplayManager()
display.display_success("Template generated successfully")
# BAD
from rich.console import Console
console = Console()
console.print("Template generated") # Don't do this!Use docstrings for all public classes and methods:
def render_template(self, template: Template, template_id: str) -> None:
"""Render a complete template display.
Args:
template: The Template object to render
template_id: The template identifier
"""
passREQUIRED before committing:
# YAML files
yamllint library/
# Python code - check and auto-fix
ruff check --fix .
# Python code - format
ruff format .# Validate all templates
python3 -m cli compose validate
# Validate specific template
python3 -m cli compose validate template-name
# Validate with semantic checks
python3 -m cli compose validate --semanticBefore submitting a PR, test your changes:
# Test template generation
python3 -m cli compose generate your-template --dry-run
# Test interactive mode
python3 -m cli compose generate your-template
# Test non-interactive mode
python3 -m cli compose generate your-template output-dir \
--var service_name=test \
--no-interactive- Features:
feature/###-description(e.g.,feature/1234-add-nginx-template) - Bug fixes:
problem/###-description(e.g.,problem/1235-fix-validation)
Follow the format: type(scope): subject
Types:
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoringtest: Adding testschore: Maintenance tasks
Examples:
feat(compose): add nginx template
fix(display): correct variable rendering for enum types
docs(wiki): update installation instructions
refactor(template): simplify Jinja2 rendering logic
Before submitting a pull request:
- Code follows style guidelines (run
ruff checkandruff format) - YAML files pass
yamllint - All templates validate successfully
- Changes are tested manually
- Commit messages follow conventions
- PR description explains the changes
- Related issues are referenced (e.g., "Closes #1234")
- PRs require approval before merging
- Address review comments promptly
- Keep PRs focused and reasonably sized
- Squash commits if requested
When creating issues, use appropriate labels:
feature- New feature requestsproblem- Bug reportsdiscussion- General discussionsquestion- Questions about usagedocumentation- Documentation improvements
- Check the Wiki for documentation
- Join Discord for discussions
- Open an issue for bugs or feature requests
- Watch YouTube tutorials
By contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to Boilerplates!