6d365dd8f11cfb440a1c7e67572d3deb10f7833f

Author
Nick Brassel <nick@tzarc.org>
Committer
GitHub <noreply@github.com>
Date

Message

Add helper `make` targets for formatting and pytest. (#23858)

Diff

 1diff --git a/Makefile b/Makefile
 2index 78d1a372bc7ee5689a3263bb560546507fe1c041..5fcd6bbf0f386fac14d0135b1ae3d23398d7d926 100644
 3--- a/Makefile
 4+++ b/Makefile
 5@@ -465,3 +465,18 @@ distclean_userspace: clean
 6 	rm -f $(QMK_USERSPACE)/*.bin $(QMK_USERSPACE)/*.hex $(QMK_USERSPACE)/*.uf2
 7 	echo 'done.'
 8 endif
 9+
10+# Extra targets for formatting and/or pytest, running within the qmk/qmk_cli container to match GHA.
11+CONTAINER_PREAMBLE := export HOME="/tmp"; export PATH="/tmp/.local/bin:\$$PATH"; python3 -m pip install --upgrade pip; python3 -m pip install -r requirements-dev.txt
12+
13+.PHONY: format-core
14+format-core:
15+	RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk format-c --core-only -a && qmk format-python -a"
16+
17+.PHONY: pytest
18+pytest:
19+	RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk pytest"
20+
21+.PHONY: format-and-pytest
22+format-and-pytest:
23+	RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk format-c --core-only -a && qmk format-python -a && qmk pytest"