module: add Makefile for development commands

This commit is contained in:
cn 2020-08-07 22:50:37 +02:00
parent 1b3fc8f2df
commit ded2908236
3 changed files with 30 additions and 2 deletions

View File

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

Makefile Normal file
View File

@ -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}'

View File

@ -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).