-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (65 loc) · 3.21 KB
/
Makefile
File metadata and controls
77 lines (65 loc) · 3.21 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
.PHONY: mypy mypy-fix ruff ruff-fix ruff-fix-unsafe version patch-version-increment minor-version-increment major-version-increment version-set install-hook help
help:
@echo "Available targets:"
@echo " mypy - Run mypy type checking on the codebase"
@echo " mypy-fix - Install missing type stubs to fix mypy import errors"
@echo " ruff - Run ruff linting and formatting checks on the codebase"
@echo " ruff-fix - Auto-fix ruff linting errors and format code (safe fixes only)"
@echo " ruff-fix-unsafe - Auto-fix ruff linting errors including unsafe fixes"
@echo " version - Show current version"
@echo " patch-version-increment - Increment patch version (0.1.0 -> 0.1.1)"
@echo " minor-version-increment - Increment minor version (0.1.0 -> 0.2.0)"
@echo " major-version-increment - Increment major version (0.1.0 -> 1.0.0)"
@echo " version-set - Set version to a specific value (usage: make version-set VERSION=1.2.3)"
@echo " install-hook - Install pre-commit hook for version checking"
mypy:
@echo "Running mypy type checking..."
uv run mypy fastskills tests examples
mypy-fix:
@echo "Installing missing type stubs for mypy..."
@echo "This will install type stubs for common packages that may be missing..."
uv run pip install types-PyYAML || echo "Note: types-PyYAML may already be installed or not available"
@echo ""
@echo "Running mypy --install-types (interactive mode)..."
@echo "This will prompt you to install type stubs for any remaining missing imports."
uv run mypy --install-types --non-interactive fastskills tests examples || true
@echo ""
@echo "Type stub installation complete. Run 'make mypy' to check for remaining errors."
ruff:
@echo "Running ruff linting and formatting checks..."
uv run ruff check fastskills tests examples
uv run ruff format --check fastskills tests examples
ruff-fix:
@echo "Auto-fixing ruff linting errors and formatting code (safe fixes only)..."
uv run ruff check --fix fastskills tests examples
uv run ruff format fastskills tests examples
ruff-fix-unsafe:
@echo "Auto-fixing ruff linting errors including unsafe fixes..."
uv run ruff check --fix --unsafe-fixes fastskills tests examples
uv run ruff format fastskills tests examples
version:
@python3 scripts/bump_version.py show
patch-version-increment:
@python3 scripts/bump_version.py patch
minor-version-increment:
@python3 scripts/bump_version.py minor
major-version-increment:
@python3 scripts/bump_version.py major
version-set:
@if [ -z "$(VERSION)" ]; then \
echo "Error: VERSION is required. Usage: make version-set VERSION=1.2.3"; \
exit 1; \
fi
@python3 scripts/bump_version.py set $(VERSION)
install-hook:
@echo "Installing pre-commit hook for version checking..."
@if [ ! -d .git ]; then \
echo "Error: Not a git repository. Run this command from the project root."; \
exit 1; \
fi
@mkdir -p .git/hooks
@cp scripts/pre-commit-version-check.sh .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "✓ Pre-commit hook installed successfully!"
@echo ""
@echo "The hook will now check that version numbers are updated when code changes are committed."