Skip to content

Commit 71638d2

Browse files
gadenbuieschloerke
andauthored
chore(make): Update check and check-fix to replicate CI (#1148)
Co-authored-by: Barret Schloerke <[email protected]>
1 parent 0123f09 commit 71638d2

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

Makefile

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help clean clean-test clean-pyc clean-build help lint test playwright-shiny playwright-examples playwright-deploys install-trcli install-playwright
1+
.PHONY: help clean% check% format% lint test pyright playwright% install% testrail% coverage release
22
.DEFAULT_GOAL := help
33

44
define BROWSER_PYSCRIPT
@@ -60,29 +60,38 @@ typings/matplotlib/__init__.pyi: ## grab type stubs from GitHub
6060
typings/seaborn:
6161
pyright --createstub seaborn
6262

63-
pyright: typings/uvicorn typings/matplotlib/__init__.pyi typings/seaborn ## type check with pyright
64-
pyright
65-
66-
lint: ## check style with flake8
67-
echo "Checking style with flake8."
63+
check: check-format check-lint check-types check-tests ## check code, style, types, and test (basic CI)
64+
check-fix: format check-lint check-types check-tests ## check and format code, style, types, and test
65+
check-format: check-black check-isort
66+
check-lint:
67+
@echo "-------- Checking style with flake8 --------"
6868
flake8 --show-source .
69-
70-
format: ## format code with black and isort
71-
echo "Formatting code with black."
72-
black .
73-
echo "Sorting imports with isort."
74-
isort .
75-
76-
check: ## check code quality with black and isort
77-
echo "Checking code with black."
69+
check-black:
70+
@echo "-------- Checking code with black --------"
7871
black --check .
79-
echo "Sorting imports with isort."
72+
check-isort:
73+
@echo "-------- Sorting imports with isort --------"
8074
isort --check-only --diff .
81-
82-
test: ## run tests quickly with the default Python
75+
check-types: typings/uvicorn typings/matplotlib/__init__.pyi typings/seaborn
76+
@echo "-------- Checking types with pyright --------"
77+
pyright
78+
check-tests:
79+
@echo "-------- Running tests with pytest --------"
8380
python3 tests/pytest/asyncio_prevent.py
8481
pytest
8582

83+
pyright: check-types ## check types with pyright
84+
lint: check-lint ## check style with flake8
85+
test: check-tests ## check tests quickly with the default Python
86+
87+
format: format-black format-isort ## format code with black and isort
88+
format-black:
89+
@echo "-------- Formatting code with black --------"
90+
black .
91+
format-isort:
92+
@echo "-------- Sorting imports with isort --------"
93+
isort .
94+
8695
# Default `SUB_FILE` to empty
8796
SUB_FILE:=
8897

0 commit comments

Comments
 (0)