From 35f63edcd86fe4937028747cec93670c0ac25ef9 Mon Sep 17 00:00:00 2001 From: Matthias Hagmann <16444067+MattHag@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:33:05 +0100 Subject: [PATCH] Makefile: Add command for formatting and linting Format code: make format Lint code (automatically fixing issues when possible): make lint Related #2295 --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6688877e..8e3703a9 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PIP_ARGS ?= . .PHONY: install_ubuntu install_macos .PHONY: install_apt install_brew install_pip .PHONY: install_udev install_udev_uinput reload_udev uninstall_udev -.PHONY: test +.PHONY: format lint test install_ubuntu: install_apt install_udev_uinput install_pip @@ -48,6 +48,14 @@ uninstall_udev: sudo rm -f $(UDEV_RULES_DEST)/$(UDEV_RULE_FILE) make reload_udev +format: + @echo "Formatting Solaar code" + ruff format . + +lint: + @echo "Linting Solaar code" + ruff check . --fix + test: @echo "Running Solaar tests" pytest --cov=lib/ tests/