Skip to content

Commit

Permalink
build: updated Makefile, added ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Nov 8, 2023
1 parent 7a139ee commit 5e7a4a7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
SRCDIRS := src/quantifiedme tests
SRCFILES := $(shell find $(SRCDIRS) -name '*.py')

# today
date := $(shell date +%Y-%m-%d)

Expand All @@ -17,20 +20,21 @@ dashboard/build/dashboard.html:
install:
poetry install

lint:
poetry run ruff $(SRCDIRS)

fmt:
black src/ tests/
poetry run ruff --fix $(SRCDIRS)
poetry run pyupgrade --py310-plus $(SRCFILES) --exit-zero-even-if-changed
poetry run black $(SRCDIRS)

test:
poetry run python3 -m pytest tests/
poetry run python3 -m pytest -v tests/ --cov=quantifiedme --durations=5

typecheck:
poetry run mypy --ignore-missing-imports --check-untyped-defs src/quantifiedme tests
poetry run mypy --ignore-missing-imports --check-untyped-defs $(SRCDIRS)

precommit:
make fmt
poetry run pyupgrade --py310-plus src/quantifiedme/**.py
make typecheck
make test
precommit: fmt typecheck test

jupyter:
# From: https://stackoverflow.com/a/47296960/965332
Expand Down

0 comments on commit 5e7a4a7

Please sign in to comment.