Thank you for your interest in contributing to the Boilerplates project! This document provides guidelines and instructions for contributing.
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:
Rationale: The CLI architecture is complex and tightly integrated. Coordinating changes ensures consistency and prevents conflicts.
Template contributions are welcome and encouraged! You can:
library/Process:
feature/###-template-name or problem/###-fix-descriptionlibrary/No prior approval needed for template contributions, but feel free to open an issue first to discuss larger changes.
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
variable_display.py)VariableCollection, DisplayManager)render_template, get_spec)DEFAULT_TIMEOUT, MAX_RETRIES)_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.html
CRITICAL RULE:
console.print() outside of display manager classesConsole from rich.console except in display manager classesALWAYS 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
"""
pass
REQUIRED 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 --semantic
Before 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
feature/###-description (e.g., feature/1234-add-nginx-template)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 tasksExamples:
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:
ruff check and ruff format)yamllintWhen creating issues, use appropriate labels:
feature - New feature requestsproblem - Bug reportsdiscussion - General discussionsquestion - Questions about usagedocumentation - Documentation improvementsBy contributing, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to Boilerplates!