Skip to content

Commit 4a59846

Browse files
Merge pull request #11 from MITLibraries/add-help-cmd-to-makefile
Add help command to Makefile
2 parents 993e05b + 1632501 commit 4a59846

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

Makefile

Lines changed: 17 additions & 14 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,32 +21,31 @@ test: # run tests and print a coverage report
1721
pipenv run coverage run --source=lambdas -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
## ---- Code quality and safety commands ---- ##
2428

25-
# linting commands
26-
lint: black mypy ruff safety
29+
lint: black mypy ruff safety # run linters
2730

28-
black:
31+
black: # run 'black' linter and print a preview of suggested changes
2932
pipenv run black --check --diff .
3033

31-
mypy:
34+
mypy: # run 'mypy' linter
3235
pipenv run mypy .
3336

34-
ruff:
37+
ruff: # run 'ruff' linter and print a preview of errors
3538
pipenv run ruff check .
3639

37-
safety:
40+
safety: # check for security vulnerabilities and verify Pipfile.lock is up-to-date
3841
pipenv check
3942
pipenv verify
4043

41-
# apply changes to resolve any linting errors
42-
lint-apply: black-apply ruff-apply
44+
lint-apply: # apply changes with 'black' and resolve 'fixable errors' with 'ruff'
45+
black-apply ruff-apply
4346

44-
black-apply:
47+
black-apply: # apply changes with 'black'
4548
pipenv run black .
4649

47-
ruff-apply:
48-
pipenv run ruff check --fix .
50+
ruff-apply: # resolve 'fixable errors' with 'ruff'
51+
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 function/functions.
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)