diff options
author | Nick Brassel <[email protected]> | 2024-06-04 12:23:25 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-04 12:23:25 +1000 |
commit | 6d365dd8f11cfb440a1c7e67572d3deb10f7833f (patch) | |
tree | 9c27ca9e032f9b86de68592adadf5b07a43f12f2 | |
parent | 8253697a6389aaec73f85a29dd25247b32389502 (diff) | |
download | qmk_firmware-6d365dd8f11cfb440a1c7e67572d3deb10f7833f.tar.gz qmk_firmware-6d365dd8f11cfb440a1c7e67572d3deb10f7833f.zip |
Add helper `make` targets for formatting and pytest. (#23858)
-rw-r--r-- | Makefile | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -465,3 +465,18 @@ distclean_userspace: clean rm -f $(QMK_USERSPACE)/*.bin $(QMK_USERSPACE)/*.hex $(QMK_USERSPACE)/*.uf2 echo 'done.' endif + +# Extra targets for formatting and/or pytest, running within the qmk/qmk_cli container to match GHA. +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 + +.PHONY: format-core +format-core: + RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk format-c --core-only -a && qmk format-python -a" + +.PHONY: pytest +pytest: + RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk pytest" + +.PHONY: format-and-pytest +format-and-pytest: + RUNTIME=docker ./util/docker_cmd.sh bash -lic "$(CONTAINER_PREAMBLE); qmk format-c --core-only -a && qmk format-python -a && qmk pytest" |