Skip to content

Commit 67ae4e1

Browse files
Update README and Makefile
* Update letter case in section headers and 'make help' documentation * Tidy header comments in Makefile
1 parent 96fb551 commit 67ae4e1

File tree

2 files changed

+42
-24
lines changed

2 files changed

+42
-24
lines changed

Makefile

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

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

8-
## ---- Dependency commands ---- ##
8+
#######################
9+
# Dependency commands
10+
#######################
911

10-
install: # install Python dependencies
12+
install: # Install Python dependencies
1113
pipenv install --dev
1214
pipenv run pre-commit install
1315

14-
update: install # update Python dependencies
16+
update: install # Update Python dependencies
1517
pipenv clean
1618
pipenv update --dev
1719

18-
## ---- Unit test commands ---- ##
20+
######################
21+
# Unit test commands
22+
######################
1923

20-
test: # run tests and print a coverage report
24+
test: # Run tests and print a coverage report
2125
pipenv run coverage run --source=lambdas -m pytest -vv
2226
pipenv run coverage report -m
2327

24-
coveralls: test # write coverage data to an LCOV report
28+
coveralls: test # Write coverage data to an LCOV report
2529
pipenv run coverage lcov -o ./coverage/lcov.info
2630

27-
## ---- Code quality and safety commands ---- ##
31+
####################################
32+
# Code quality and safety commands
33+
####################################
2834

29-
lint: black mypy ruff safety # run linters
35+
lint: black mypy ruff safety # Run linters
3036

31-
black: # run 'black' linter and print a preview of suggested changes
37+
black: # Run 'black' linter and print a preview of suggested changes
3238
pipenv run black --check --diff .
3339

34-
mypy: # run 'mypy' linter
40+
mypy: # Run 'mypy' linter
3541
pipenv run mypy .
3642

37-
ruff: # run 'ruff' linter and print a preview of errors
43+
ruff: # Run 'ruff' linter and print a preview of errors
3844
pipenv run ruff check .
3945

40-
safety: # check for security vulnerabilities and verify Pipfile.lock is up-to-date
46+
safety: # Check for security vulnerabilities and verify Pipfile.lock is up-to-date
4147
pipenv check
4248
pipenv verify
4349

44-
lint-apply: # apply changes with 'black' and resolve 'fixable errors' with 'ruff'
50+
lint-apply: # Apply changes with 'black' and resolve 'fixable errors' with 'ruff'
4551
black-apply ruff-apply
4652

47-
black-apply: # apply changes with 'black'
53+
black-apply: # Apply changes with 'black'
4854
pipenv run black .
4955

50-
ruff-apply: # resolve 'fixable errors' with 'ruff'
56+
ruff-apply: # Resolve 'fixable errors' with 'ruff'
5157
pipenv run ruff check --fix .

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A template repository for creating Python lambda functions.
44

5-
## Repo setup (delete this section and above after initial function setup)
5+
## Repo Setup (delete this section and above after initial function setup)
66

77
1. Rename "my_function" to the desired initial function name across the repo. (May be helpful to do a project-wide find-and-replace).
88
2. Update Python version if needed (note: AWS lambda cannot currently support versions higher than 3.9).
@@ -32,12 +32,7 @@ Description of the function/functions.
3232
- To run unit tests: `make test`
3333
- To lint the repo: `make lint`
3434

35-
## Required ENV
36-
37-
- `SENTRY_DSN` = If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development.
38-
- `WORKSPACE` = Set to `dev` for local development, this will be set to `stage` and `prod` in those environments by Terraform.
39-
40-
## Running locally
35+
## Running Locally with Docker
4136

4237
<https://docs.aws.amazon.com/lambda/latest/dg/images-test.html>
4338

@@ -65,10 +60,27 @@ Description of the function/functions.
6560
"You have successfully called this lambda!"
6661
```
6762

68-
## Running a different handler in the container
63+
## Running a Specific Handler Locally with Docker
6964

7065
If this repo contains multiple lambda functions, you can call any handler you copy into the container (see Dockerfile) by name as part of the `docker run` command:
7166

7267
```bash
7368
docker run -p 9000:8080 my_function:latest lambdas.<a-different-module>.lambda_handler
7469
```
70+
71+
## Environment Variables
72+
73+
### Required
74+
75+
```shell
76+
SENTRY_DSN=### If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development.
77+
WORKSPACE=### Set to `dev` for local development, this will be set to `stage` and `prod` in those environments by Terraform.
78+
```
79+
80+
### Optional
81+
82+
_Delete this section if it isn't applicable to the PR._
83+
84+
```shell
85+
<OPTIONAL_ENV>=### Description for optional environment variable
86+
```

0 commit comments

Comments
 (0)