-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (78 loc) · 3.46 KB
/
Makefile
File metadata and controls
92 lines (78 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Makefile for LocaleSync
#
# Provides convenience commands for common development tasks.
#
# ⚠️ IMPORTANT: This Makefile is provided for convenience only.
# It may not work in every environment due to differences in:
# - Shell (bash vs zsh vs fish vs sh)
# - OS (macOS vs Linux vs Windows/WSL)
# - Python installation (system, pyenv, conda, brew, etc.)
# - Virtual environment setup
# - System permissions
# - Installed system dependencies
#
# If any command fails, fall back to the step-by-step instructions
# in README.md and CONTRIBUTING.md — those are the reliable/default approach.
.PHONY: help install dev test lint format check clean playground-demo playground-reset quickstart
# Default Python — override with: make install PYTHON=python3.12
PYTHON ?= python3
help: ## Show this help message
@echo "LocaleSync Development Commands"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "⚠️ These commands are convenience shortcuts."
@echo " If anything fails, use the step-by-step guide in README.md."
install: ## Install LocaleSync in editable mode
$(PYTHON) -m pip install -e .
dev: ## Install with dev dependencies
$(PYTHON) -m pip install -e ".[dev]"
test: ## Run the test suite
$(PYTHON) -m pytest tests/ -v --tb=short
test-cov: ## Run tests with coverage report
$(PYTHON) -m pytest tests/ --cov=locale_sync --cov-report=term-missing --tb=short
lint: ## Run linter checks
ruff check src/ tests/
ruff format --check src/ tests/
format: ## Auto-format code
ruff check --fix src/ tests/
ruff format src/ tests/
check: ## Run LocaleSync check on playground locales
locale-sync check playground/locales
playground-demo: ## Run the interactive playground demo
bash playground/scripts/demo.sh
playground-reset: ## Reset playground files to original state
git checkout -- playground/locales/
rm -f playground/locales/*.bak
clean: ## Remove build artifacts and caches
rm -rf build/ dist/ *.egg-info src/*.egg-info
rm -rf .pytest_cache .ruff_cache htmlcov .coverage
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# QUICK START — One-command setup (best-effort, see README for details)
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
quickstart: ## ⚡ One-command setup: install + test + lint + verify
@echo "━━━ LocaleSync Quick Start ━━━"
@echo ""
@echo "⚠️ This is a convenience shortcut. If it fails, use the"
@echo " step-by-step instructions in README.md instead."
@echo ""
$(PYTHON) -m pip install -e ".[dev]"
@echo ""
@echo "━━━ Running tests ━━━"
$(PYTHON) -m pytest tests/ -v --tb=short
@echo ""
@echo "━━━ Running linter ━━━"
ruff check src/ tests/ || true
@echo ""
@echo "━━━ Verifying CLI ━━━"
locale-sync --version
locale-sync scan playground/locales
@echo ""
@echo "━━━ ✅ Quick start complete! ━━━"
@echo ""
@echo "Try these commands:"
@echo " locale-sync check playground/locales"
@echo " locale-sync sync playground/locales --dry-run"
@echo " make playground-demo"