forked from HorizonRobotics/HoloMotion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (33 loc) · 1.01 KB
/
Makefile
File metadata and controls
41 lines (33 loc) · 1.01 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
# Variables
PY_SRC := holomotion/ # Your Python code directory
RUFF := ruff # Assumes Ruff is installed locally
PYTEST := pytest -v
TESTS := holomotion/tests/
COV := --cov=holomotion/src --cov-report=term-missing
# Directory to lint/format - can be overridden with DIR=path
DIR ?= holomotion/src
.PHONY: lint format check lint-dir format-dir
# Run Ruff linter on default directory
lint:
@echo "Linting with Ruff..."
@$(RUFF) check $(PY_SRC)
# Format code in default directory
format:
@echo "Formatting with Ruff..."
@$(RUFF) format $(PY_SRC)
@$(RUFF) check --fix $(PY_SRC) # Auto-fix lint errors
# Run Ruff linter on specific directory (with fallback)
lint-dir:
@echo "Linting directory: $(DIR)"
@$(RUFF) check $(DIR)
# Format code in specific directory (with fallback)
format-dir:
@echo "Formatting directory: $(DIR)"
@$(RUFF) format $(DIR)
@$(RUFF) check --fix $(DIR) # Auto-fix lint errors
# Strict check (for CI)
check:
@$(RUFF) check $(PY_SRC) --exit-non-zero-on-fix
# Run all tests
test:
$(PYTEST) $(TESTS)