-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (26 loc) · 1.16 KB
/
Makefile
File metadata and controls
33 lines (26 loc) · 1.16 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
# Common setup for all stages
.PHONY: common_deps fmt-check fmt-fix help
SCRIPTS_DIR = ./scripts
common_deps: ## Install common Python dependencies for transformers
cd transformers && make common_deps
fmt-deps: ## Install black and pylint for formatting and linting
pip install --upgrade black[jupyter] pylint -q
cd transformers && make common_deps
fmt-check: fmt-deps ## Check Python code formatting and linting
@$(SHELL) "$(SCRIPTS_DIR)/bootstrap.sh" fmt
@echo "✅ All formatting and linting checks passed successfully!"
fmt-fix: fmt-deps ## Fix Python code formatting automatically
@$(SHELL) "$(SCRIPTS_DIR)/bootstrap.sh" fmt --fix
# Show help
help: ## Show this help message
@echo "Usage:"
@echo " make [target]"
@echo ""
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Examples:"
@printf " \033[36m%s\033[0m\n %s\n\n" \
"make fmt-check" "Check Python code formatting and linting" \
"make fmt-fix" "Fix Python code formatting automatically" \
"make common_deps" "Install common Python dependencies for transformers"