module: add Makefile for development commands

cn 2 years ago
parent 1b3fc8f2df
commit ded2908236
  1. 4
  2. 24
  3. 4

@ -13,5 +13,5 @@ install:
- poetry install
- poetry run pylint veml6070
- poetry run pytest
- make lint
- make test

@ -0,0 +1,24 @@
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: all
all: lint test ## Run lint and test (default goal)
.PHONY: lint
lint: ## Lint all source code
poetry run pylint veml6070
.PHONY: test
test: ## Run all tests
poetry run pytest
.PHONY: help
help: ## Print this help text
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

@ -21,6 +21,10 @@ In September 2019 it was discovered (and fixed) that:
- previously the sensor was never shutdown between measurements which wastes power but still takes measurements successfully
- the UVA light intensity was calculated wrongly (too high) for `rset != RSET_240K` due to wrong compensation: higher `rset` leads to higher sampling time leads to higher absolute ADC step counts which *should* lead to every ADC step indicating a smaller amount of `W/(m*m)` of UVA power and a higher precision of the final UVA power but it wrongly behaved the opposite way. The `integration_time` worked correctly all the time.
## Develop
Run `make help` to find out about the available development commands.
## License
Python files in this repository are released under the [MIT license](LICENSE).