Makefile: Add command for formatting and linting

Format code:
make format

Lint code (automatically fixing issues when possible):
make lint

Related #2295
This commit is contained in:
Matthias Hagmann 2024-02-20 00:33:05 +01:00 committed by Peter F. Patel-Schneider
parent fb6285606d
commit 35f63edcd8
1 changed files with 9 additions and 1 deletions

View File

@ -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/