Thank you for your interest in contributing! This document provides guidelines and information for contributors.
- Python 3.12 or higher
- Git
# 1. Clone the repository
git clone https://github.com/polprog-tech/LocaleSync.git
cd LocaleSync
# 2. (Recommended) Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# 3. Install in editable mode with dev dependencies
pip install -e ".[dev]"
# 4. Verify the installation
locale-sync --version
pytest# All tests
pytest
# With verbose output
pytest -v
# With coverage
pytest --cov=locale_sync --cov-report=term-missing
# Specific test file or class
pytest tests/unit/domain/test_models.py
pytest tests/unit/domain/test_models.py::TestLocaleKeyruff check src/ tests/
ruff format --check src/ tests/
# Auto-fix
ruff check --fix src/ tests/
ruff format src/ tests/locale-sync scan playground/locales
locale-sync check playground/locales
locale-sync sync playground/locales --dry-runPlease read docs/architecture.md before making changes. Key principles:
- Domain layer (
src/locale_sync/domain/) has zero external dependencies - Application layer orchestrates but does not import infrastructure directly at module level
- Infrastructure layer implements domain contracts (Protocols)
- CLI layer is a thin adapter between user input and application use cases
| What | Where |
|---|---|
| New model/value object | domain/models.py |
| New contract/interface | domain/contracts.py |
| New exception type | domain/exceptions.py |
| New file format parser | infrastructure/parsers/ |
| New file format writer | infrastructure/writers/ |
| New translation provider | infrastructure/translators/ |
| New report format | infrastructure/reporters/ |
| New CLI command | cli/commands/ |
| New use case | application/ |
See docs/extensibility.md for detailed guidance.
- Fork the repository and create a feature branch from
main - Make your changes following the architecture guidelines
- Add tests for new functionality
- Ensure all tests pass:
pytest - Ensure linting passes:
ruff check src/ tests/ - Update documentation if needed
- Submit a pull request using the PR template
Use conventional commit style:
feat: add YAML format support
fix: handle empty nested objects in JSON parser
docs: update extensibility guide with YAML example
test: add edge case tests for placeholder detection
refactor: extract common file resolution logic
- Full type hints on all function signatures
- Docstrings on public classes and functions
- Use
from __future__ import annotationsin all modules - Follow existing patterns in the codebase
- Let
ruffhandle formatting
Use the GitHub issue templates:
- Bug reports - include reproduction steps, expected vs actual behavior, and environment details
- Feature requests - describe the problem, proposed solution, and alternatives considered
By contributing, you agree that your contributions will be licensed under the same license as the project (AGPL-3.0).