From fd6c38b8573bb58baa8351d1ef22d306c958dc3e Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Feb 2024 10:45:12 -0500 Subject: [PATCH 1/4] chore(make): Update check and check-fix to replicate CI --- Makefile | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index c0d12931c..e77ffe845 100644 --- a/Makefile +++ b/Makefile @@ -60,29 +60,38 @@ typings/matplotlib/__init__.pyi: ## grab type stubs from GitHub typings/seaborn: pyright --createstub seaborn -pyright: typings/uvicorn typings/matplotlib/__init__.pyi typings/seaborn ## type check with pyright - pyright - -lint: ## check style with flake8 - echo "Checking style with flake8." +check: check-format check-lint check-types check-tests ## check code, style, pyright, test (basic CI) +check-fix: format check-lint check-types check-tests ## check and format code, style, lint, test +check-format: check-black check-isort +check-lint: + @echo "-------- Checking style with flake8 --------" flake8 --show-source . - -format: ## format code with black and isort - echo "Formatting code with black." - black . - echo "Sorting imports with isort." - isort . - -check: ## check code quality with black and isort - echo "Checking code with black." +check-black: + @echo "-------- Checking code with black --------" black --check . - echo "Sorting imports with isort." +check-isort: + @echo "-------- Sorting imports with isort --------" isort --check-only --diff . - -test: ## run tests quickly with the default Python +check-types: typings/uvicorn typings/matplotlib/__init__.pyi typings/seaborn + @echo "-------- Checking types with pyright --------" + pyright +check-tests: + @echo "-------- Running tests with pytest --------" python3 tests/pytest/asyncio_prevent.py pytest +pyright: check-types ## check types with pyright +lint: check-lint ## check style with flake8 +test: check-tests ## check tests quickly with the default Python + +format: format-black format-isort ## format code with black and isort +format-black: + @echo "-------- Formatting code with black --------" + black . +format-isort: + @echo "-------- Sorting imports with isort --------" + isort . + # Default `SUB_FILE` to empty SUB_FILE:= From 5884859b1cd6adcb5ed0d1b270ac11411e1d95c0 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Feb 2024 11:17:32 -0500 Subject: [PATCH 2/4] fix: typo in target comment --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e77ffe845..cf7229f58 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ typings/matplotlib/__init__.pyi: ## grab type stubs from GitHub typings/seaborn: pyright --createstub seaborn -check: check-format check-lint check-types check-tests ## check code, style, pyright, test (basic CI) -check-fix: format check-lint check-types check-tests ## check and format code, style, lint, test +check: check-format check-lint check-types check-tests ## check code, style, types, and test (basic CI) +check-fix: format check-lint check-types check-tests ## check and format code, style, types, and test check-format: check-black check-isort check-lint: @echo "-------- Checking style with flake8 --------" From 5436b7001c30c1b4a2ca7f4818f326e835fd5012 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Feb 2024 11:23:56 -0500 Subject: [PATCH 3/4] chore: mark all clean, check, format targets as `.PHONY` --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cf7229f58..d84e9abaf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help clean clean-test clean-pyc clean-build help lint test playwright-shiny playwright-examples playwright-deploys install-trcli install-playwright +.PHONY: help clean% check% format% help lint test playwright-shiny playwright-examples playwright-deploys install-trcli install-playwright .DEFAULT_GOAL := help define BROWSER_PYSCRIPT From 4f453b6e6be7ca8fbd594c3c6b56206b53e36b6c Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Feb 2024 11:38:07 -0500 Subject: [PATCH 4/4] chore: more phony targets Co-authored-by: Barret Schloerke --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d84e9abaf..dd60d32c1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help clean% check% format% help lint test playwright-shiny playwright-examples playwright-deploys install-trcli install-playwright +.PHONY: help clean% check% format% lint test pyright playwright% install% testrail% coverage release .DEFAULT_GOAL := help define BROWSER_PYSCRIPT