forked from awslabs/stickler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.37 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.37 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
# Simple Makefile for stickler
# Define color codes for terminal output
RED := \033[0;31m
GREEN := \033[0;32m
YELLOW := \033[1;33m
NC := \033[0m # No Color
install:
pip install -e .
install-dev:
pip install -e ".[dev]"
test:
pytest tests/
clean:
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
# Run linting checks and automatically fix issues
lint:
ruff check --fix
.PHONY: docs docs-build docs-install
# Install docs dependencies (mkdocs, material theme, etc.)
docs-install:
pip install -r docs/requirements.txt
# Start local docs site with live reload (http://127.0.0.1:8000)
docs:
$(MAKE) -C docs docs
# Build docs site (validates links and generates static site)
docs-build:
$(MAKE) -C docs build
# CI/CD version of lint that only checks but doesn't modify files
# Used in CI pipelines to verify code quality without making changes
lint-cicd:
@echo "Running code quality checks..."
@if ! ruff check; then \
echo -e "$(RED)ERROR: Ruff linting failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make ruff-lint' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@if ! ruff format --check; then \
echo -e "$(RED)ERROR: Code formatting check failed!$(NC)"; \
echo -e "$(YELLOW)Please run 'make format' locally to fix these issues.$(NC)"; \
exit 1; \
fi
@echo -e "$(GREEN)All code quality checks passed!$(NC)"