Skip to content

Commit

Permalink
Makefile: Add command for formatting and linting
Browse files Browse the repository at this point in the history
Format code:
make format

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

Related pwr-Solaar#2295
  • Loading branch information
MattHag committed Feb 20, 2024
1 parent 35016b3 commit 9cf2e16
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/

0 comments on commit 9cf2e16

Please sign in to comment.