From 1d55791120e9b7b38b10e6235bb9f97b18ac82cf Mon Sep 17 00:00:00 2001 From: Abishek Newar Date: Sat, 25 Oct 2025 19:03:22 +0530 Subject: [PATCH 1/3] Added a top-level Makefile in js-sdk to simplify running tests and linters --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..43b64d1 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +.PHONY: sync test lint fmt check + +# Install/update dependencies +sync: + uv sync + +# Run tests with coverage +# Usage: make test +# To run a specific test: make test TEST=test_file.py::test_function +test: + uv run pytest --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test/) + +# Run linter +lint: + uv run ruff check . + +# Format code +fmt: + uv run ruff format . + +# Run checks (lint + test) +check: test test + +# Show help +doc: + @echo "Available targets:" + @echo " sync - Install/update dependencies" + @echo " test - Run tests with coverage (use TEST=path.to.test to run specific tests)" + @echo " lint - Run linter checks" + @echo " fmt - Format code" + @echo " check - Run both linting and tests" + @echo " doc - Show this help message" From 37d7938ee3f4e6acdf28f664a7f62342461b7f60 Mon Sep 17 00:00:00 2001 From: Abishek Newar <97790157+Abishek-Newar@users.noreply.github.com> Date: Sat, 25 Oct 2025 19:21:34 +0530 Subject: [PATCH 2/3] Made suggested changes in MakeFile Fixed a typo in MakeFile Co-authored-by: Anurag Bandyopadhyay --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 43b64d1..b0834a4 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ fmt: uv run ruff format . # Run checks (lint + test) -check: test test +check: lint test # Show help doc: From 7ebdcdb652a7733514cfb1e05612928c54a317ac Mon Sep 17 00:00:00 2001 From: Abishek Newar Date: Sat, 25 Oct 2025 19:35:56 +0530 Subject: [PATCH 3/3] chore: added fix in makefile --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b0834a4..c9361ba 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: sync test lint fmt check +.PHONY: sync test lint fmt fix check doc # Install/update dependencies sync: @@ -18,8 +18,13 @@ lint: fmt: uv run ruff format . +# Fix fixable linting and formatting issues +fix: + uv run ruff check --fix . + uv run ruff format . + # Run checks (lint + test) -check: lint test +check: lint fmt test # Show help doc: @@ -28,5 +33,6 @@ doc: @echo " test - Run tests with coverage (use TEST=path.to.test to run specific tests)" @echo " lint - Run linter checks" @echo " fmt - Format code" + @echo " fix - Fix fixable linting and formatting issues" @echo " check - Run both linting and tests" @echo " doc - Show this help message"