Skip to content

Commit 94e817a

Browse files
chore: Added a top-level Makefile in python-sdk to simplify running tests and linters (#241)
* Added a top-level Makefile in js-sdk to simplify running tests and linters * Made suggested changes in MakeFile Fixed a typo in MakeFile Co-authored-by: Anurag Bandyopadhyay <[email protected]> * chore: added fix in makefile --------- Co-authored-by: Anurag Bandyopadhyay <[email protected]>
1 parent 759afd0 commit 94e817a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.PHONY: sync test lint fmt fix check doc
2+
3+
# Install/update dependencies
4+
sync:
5+
uv sync
6+
7+
# Run tests with coverage
8+
# Usage: make test
9+
# To run a specific test: make test TEST=test_file.py::test_function
10+
test:
11+
uv run pytest --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/)
12+
13+
# Run linter
14+
lint:
15+
uv run ruff check .
16+
17+
# Format code
18+
fmt:
19+
uv run ruff format .
20+
21+
# Fix fixable linting and formatting issues
22+
fix:
23+
uv run ruff check --fix .
24+
uv run ruff format .
25+
26+
# Run checks (lint + test)
27+
check: lint fmt test
28+
29+
# Show help
30+
doc:
31+
@echo "Available targets:"
32+
@echo " sync - Install/update dependencies"
33+
@echo " test - Run tests with coverage (use TEST=path.to.test to run specific tests)"
34+
@echo " lint - Run linter checks"
35+
@echo " fmt - Format code"
36+
@echo " fix - Fix fixable linting and formatting issues"
37+
@echo " check - Run both linting and tests"
38+
@echo " doc - Show this help message"

0 commit comments

Comments
 (0)