Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add help command to Makefile #14

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
SHELL=/bin/bash
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)

help: # preview Makefile commands
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

## ---- Dependency commands ---- ##

install: # install dependencies
install: # install Python dependencies
jonavellecuerdo marked this conversation as resolved.
Show resolved Hide resolved
pipenv install --dev
pipenv run pre-commit install

update: install # update all Python dependencies
update: install # update Python dependencies
pipenv clean
pipenv update --dev

Expand All @@ -17,33 +21,32 @@ test: # run tests and print a coverage report
pipenv run coverage run --source=my_app -m pytest -vv
pipenv run coverage report -m

coveralls: test
coveralls: test # write coverage data to an LCOV report
pipenv run coverage lcov -o ./coverage/lcov.info


## ---- Code quality and safety commands ---- ##

# linting commands
lint: black mypy ruff safety
lint: black mypy ruff safety # run linters

black:
black: # run 'black' linter and print a preview of suggested changes
pipenv run black --check --diff .

mypy:
mypy: # run 'mypy' linter
pipenv run mypy .

ruff:
ruff: # run 'ruff' linter and print a preview of errors
pipenv run ruff check .

safety:
safety: # check for security vulnerabilities and verify Pipfile.lock is up-to-date
pipenv check
pipenv verify

# apply changes to resolve any linting errors
lint-apply: black-apply ruff-apply
lint-apply: # apply changes with 'black' and resolve 'fixable errors' with 'ruff'
black-apply ruff-apply

black-apply:
black-apply: # apply changes with 'black'
pipenv run black .

ruff-apply:
ruff-apply: # resolve 'fixable errors' with 'ruff'
pipenv run ruff check --fix .
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Description of the app

## Development

- To preview a list of available Makefile commands: `make help`
- To install with dev dependencies: `make install`
- To update dependencies: `make update`
- To run unit tests: `make test`
Expand Down
Loading