summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-03 23:18:36 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-03 23:18:39 -0700
commitba7295cdf09c6b2bf288db85e15aa44b6782da06 (patch)
treef22a0a4a87e291d7e89de5ea32f749952bee5802 /Makefile
parent5ef9d9c429d8215e2f29f5cd8edfceab0b9fb648 (diff)
downloadfatcat-scholar-ba7295cdf09c6b2bf288db85e15aa44b6782da06.tar.gz
fatcat-scholar-ba7295cdf09c6b2bf288db85e15aa44b6782da06.zip
makefile: more lints; fixes
- allow digits in "help" targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 21 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 61e9a4b..428b0a6 100644
--- a/Makefile
+++ b/Makefile
@@ -6,12 +6,29 @@ SHELL = /bin/bash
help: ## Print info about all commands
@echo "Commands:"
@echo
- @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
+
+.PHONY: deps
+deps: ## Install dependencies using pipenv
+ pipenv install --dev
+
+.PHONY: lint
+lint: ## Run lints (eg, flake8, mypy)
+ pipenv run flake8 fatcat_scholar/ tests/ --exit-zero
+ pipenv run mypy fatcat_scholar/ tests/ --ignore-missing-imports
+ #pipenv run pytype fatcat_scholar/
+
+.PHONY: fmt
+fmt: ## Run code formating on all source code
+ pipenv run black fatcat_scholar/ tests/
.PHONY: test
-test: ## Run all tests and lints
+test: lint ## Run all tests and lints
ENV_FOR_DYNACONF=test pipenv run pytest
- pipenv run mypy fatcat_scholar/*.py tests/ --ignore-missing-imports
+
+.PHONY: coverage
+coverage: lint ## Run all tests with coverage
+ ENV_FOR_DYNACONF=test pipenv run pytest --cov
.PHONY: dev
dev: ## Run web service locally, with reloading
@@ -37,7 +54,7 @@ dev-index: ## Delete/Create DEV elasticsearch fulltext index locally
cat data/sim_intermediate.json data/work_intermediate.json | pipenv run python -m fatcat_scholar.transform run_transform | esbulk -verbose -size 200 -id key -w 4 -index dev_scholar_fulltext_v01 -type _doc
.PHONY: update-i18n
-update-i18n: ## Re-extract and compile translation files
+update-i18n: ## Re-extract and compile translation files
pipenv run pybabel extract -F extra/i18n/babel.cfg -o extra/i18n/web_interface.pot fatcat_scholar/
pipenv run pybabel update -i extra/i18n/web_interface.pot -d fatcat_scholar/translations
pipenv run pybabel compile -d fatcat_scholar/translations