-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (74 loc) · 2.36 KB
/
Makefile
File metadata and controls
98 lines (74 loc) · 2.36 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
93
94
95
96
97
98
# Makefile for BigQuery SQL Antipattern Checker
.PHONY: help install install-dev clean lint format type-check test test-cov security docs build check-all
# Default target
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# Installation
install: ## Install the package
pip install -e .
install-dev: ## Install development dependencies
pip install -e .[dev]
pre-commit install
pre-commit install --hook-type commit-msg
# Cleaning
clean: ## Clean build artifacts
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -delete
find . -type f -name "*.pyc" -delete
# Code quality
lint: ## Run linting with ruff
ruff check src tests
lint-fix: ## Run linting with ruff and fix issues
ruff check --fix src tests
format: ## Format code with ruff
ruff format src tests
format-check: ## Check code formatting
ruff format --check src tests
type-check: ## Run type checking with mypy
mypy src/
# Testing
test: ## Run tests
pytest
test-watch: ## Run tests in watch mode
pytest --watch
# Security
security: ## Run security checks
bandit -r src/
safety check
# Documentation
docs: ## Check documentation coverage
interrogate src/
# Dead code detection
dead-code: ## Find dead code with vulture
vulture src/
# Build
build: ## Build the package
python -m build
# Comprehensive checks
check-all: lint type-check test security docs ## Run all checks
# Pre-commit
pre-commit: ## Run pre-commit hooks on all files
pre-commit run --all-files
# Development workflow
dev-setup: clean install-dev ## Setup development environment
@echo "Development environment setup complete!"
@echo "Run 'make check-all' to verify everything is working."
# Release workflow
release-check: clean check-all build ## Check if ready for release
@echo "Release check complete!"
# Quick development commands
quick-check: lint-fix format type-check ## Quick development check
@echo "Quick check complete!"
# Install and run the CLI
run-create-config: ## Create a config file using the CLI
bq-antipattern-checker create-config
run-list-antipatterns: ## List available antipatterns
bq-antipattern-checker list-antipatterns
run-help: ## Show CLI help
bq-antipattern-checker --help