This commit is contained in:
vbarda
2024-06-17 21:12:53 -04:00
parent 1a06d500d4
commit d3ab444edf
6 changed files with 124 additions and 18 deletions
+28 -10
View File
@@ -1,13 +1,31 @@
.PHONY: lint format
.PHONY: test lint format
lint:
poetry run ruff .
poetry run ruff format . --diff
poetry run mypy .
format:
poetry run ruff format .
poetry run ruff --select I --fix .
######################
# TESTING AND COVERAGE
######################
test:
poetry run pytest tests
poetry run pytest tests
######################
# LINTING AND FORMATTING
######################
# Define a variable for Python and notebook files.
PYTHON_FILES=.
MYPY_CACHE=.mypy_cache
lint format: PYTHON_FILES=.
lint_diff format_diff: PYTHON_FILES=$(shell git diff --name-only --relative --diff-filter=d main . | grep -E '\.py$$|\.ipynb$$')
lint_package: PYTHON_FILES=langgraph_cli
lint_tests: PYTHON_FILES=tests
lint_tests: MYPY_CACHE=.mypy_cache_test
lint lint_diff lint_package lint_tests:
poetry run ruff .
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff --select I $(PYTHON_FILES)
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) || poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
format format_diff:
poetry run ruff format $(PYTHON_FILES)
poetry run ruff --select I --fix $(PYTHON_FILES)