forked from quarylabs/sqruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (50 loc) · 1.87 KB
/
Makefile
File metadata and controls
64 lines (50 loc) · 1.87 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
.PHONY: help
help: ## Display this help screen
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: python_fmt
python_fmt: ## Format python code
uv run ruff format .
.PHONY: python_lint
python_lint: ## Lint python code
uv run ruff format --check .
uv run ruff check .
.PHONY: python_test
python_test: ## Run python tests
uv run pytest
.PHONY: python_sync
python_sync: ## Sync python dependencies using uv (uses uv.lock)
uv sync --extra dev
.PHONY: python_generate_gha
python_generate_gha: ## Generate GitHub Actions workflow
maturin generate-ci github --manifest-path "crates/cli/Cargo.toml" --output .github/workflows/python-ci.yaml
.PHONY: python_ci
python_ci: python_test ## Run python CI (ruff checks moved to bazel)
.PHONY: rust_fmt
rust_fmt: ## Format rust code
cargo fmt --all
.PHONY: rust_lint
rust_lint: ## Lint rust code
cargo fmt --all -- --check
cargo clippy --all --all-features -- -D warnings
cargo machete
cargo hack check --each-feature --exclude-features=codegen-docs
.PHONY: rust_test
rust_test: python_sync ## Run rust tests
uv run maturin develop --manifest-path crates/cli-python/Cargo.toml
cargo test --no-fail-fast --manifest-path ./crates/cli/Cargo.toml
cargo test --no-fail-fast --all --all-features --exclude sqruff
.PHONY: ci
ci: ratchet_check python_ci rust_test ## Run all CI checks
.PHONY: ratchet_pin
ratchet_pin: ## Pins all the Github workflow versions
ratchet pin .github/workflows/*
.PHONY: ratchet_update
ratchet_update: ## Updates all the Github workflow versions
ratchet update .github/workflows/*
.PHONY: ratchet_check
ratchet_check: ## Checks all the Github workflow versions
ratchet lint .github/workflows/*
.PHONY: load_vscode_settings
load_vscode_settings: ## Loads the sample vscode settings
mkdir -p .vscode
cp -f .hacking/vscode/* .vscode/