Skip to content

Commit 022327e

Browse files
Merge pull request #14 from MITLibraries/add-help-cmd-to-makefile
Add help command to Makefile
2 parents 0ca4456 + c966305 commit 022327e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
SHELL=/bin/bash
22
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
33

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

6-
install: # install dependencies
10+
install: # install Python dependencies
711
pipenv install --dev
812
pipenv run pre-commit install
913

10-
update: install # update all Python dependencies
14+
update: install # update Python dependencies
1115
pipenv clean
1216
pipenv update --dev
1317

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

20-
coveralls: test
24+
coveralls: test # write coverage data to an LCOV report
2125
pipenv run coverage lcov -o ./coverage/lcov.info
2226

2327

2428
## ---- Code quality and safety commands ---- ##
2529

26-
# linting commands
27-
lint: black mypy ruff safety
30+
lint: black mypy ruff safety # run linters
2831

29-
black:
32+
black: # run 'black' linter and print a preview of suggested changes
3033
pipenv run black --check --diff .
3134

32-
mypy:
35+
mypy: # run 'mypy' linter
3336
pipenv run mypy .
3437

35-
ruff:
38+
ruff: # run 'ruff' linter and print a preview of errors
3639
pipenv run ruff check .
3740

38-
safety:
41+
safety: # check for security vulnerabilities and verify Pipfile.lock is up-to-date
3942
pipenv check
4043
pipenv verify
4144

42-
# apply changes to resolve any linting errors
43-
lint-apply: black-apply ruff-apply
45+
lint-apply: # apply changes with 'black' and resolve 'fixable errors' with 'ruff'
46+
black-apply ruff-apply
4447

45-
black-apply:
48+
black-apply: # apply changes with 'black'
4649
pipenv run black .
4750

48-
ruff-apply:
51+
ruff-apply: # resolve 'fixable errors' with 'ruff'
4952
pipenv run ruff check --fix .

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Description of the app
2626

2727
## Development
2828

29+
- To preview a list of available Makefile commands: `make help`
2930
- To install with dev dependencies: `make install`
3031
- To update dependencies: `make update`
3132
- To run unit tests: `make test`

0 commit comments

Comments
 (0)