From ded29082367db626d292a0b354a46571f5bcf0b6 Mon Sep 17 00:00:00 2001 From: cn Date: Fri, 7 Aug 2020 22:50:37 +0200 Subject: [PATCH] module: add Makefile for development commands --- .travis.yml | 4 ++-- Makefile | 24 ++++++++++++++++++++++++ README.md | 4 ++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index 2aa90f3..feaf9ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,5 @@ install: - poetry install script: -- poetry run pylint veml6070 -- poetry run pytest +- make lint +- make test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4d255de --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ + +# https://tech.davis-hansson.com/p/make/ +SHELL := bash +.ONESHELL: +.SHELLFLAGS := -eu -o pipefail -c +.DELETE_ON_ERROR: +.DEFAULT_GOAL := all +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}' diff --git a/README.md b/README.md index 53e2c15..7b6a35b 100644 --- a/README.md +++ b/README.md @@ -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).