Skip to content

Commit 50b8efc

Browse files
committed
Merge branch 'develop' into chore/improve-tests-setup
* develop: docs: customize contributing guide (#77) chore: move blockquotes as hidden comments
2 parents acfd083 + 57d2905 commit 50b8efc

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
## Description of changes:
44

5-
> One or two sentences as a summary of what's being changed
5+
<!--- One or two sentences as a summary of what's being changed -->
6+
7+
**Checklist**
8+
9+
<!--- Leave unchecked if your change doesn't seem to apply -->
610

711
* [ ] [Meet tenets criteria](https://awslabs.github.io/aws-lambda-powertools-python/#tenets)
812
* [ ] Update tests
@@ -11,7 +15,7 @@
1115

1216
## Breaking change checklist
1317

14-
> Ignore if it's not a breaking change
18+
<!--- Ignore if it's not a breaking change -->
1519

1620
**RFC issue #**:
1721

CONTRIBUTING.md

+34-18
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,66 @@ documentation, we greatly value feedback and contributions from our community.
66
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
109
## Reporting Bugs/Feature Requests
1110

12-
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
11+
We welcome you to use the GitHub issue tracker to report bugs, suggest features, or documentation improvements.
1312

1413
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15-
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16-
17-
* A reproducible test case or series of steps
18-
* The version of our code being used
19-
* Any modifications you've made relevant to the bug
20-
* Anything unusual about your environment or deployment
21-
14+
reported the issue. Please try to include as much information as you can.
2215

2316
## Contributing via Pull Requests
17+
2418
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2519

26-
1. You are working against the latest source on the *master* branch.
27-
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28-
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
20+
1. You are working against the latest source on the **develop** branch.
21+
2. You check existing open, and recently merged pull requests to make sure someone else hasn't addressed the problem already.
22+
3. You open a [RFC issue](https://github.com/awslabs/aws-lambda-powertools-python/issues/new?assignees=&labels=RFC%2C+triage&template=rfc.md&title=RFC%3A+) to discuss any significant work - we would hate for your time to be wasted.
23+
24+
### Dev setup
2925

30-
To send us a pull request, please:
26+
To send us a pull request, please follow these steps:
3127

3228
1. Fork the repository.
33-
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34-
3. Ensure local tests pass.
29+
2. Install dependencies in a virtual env with poetry, and pre-commit hooks: `make dev`
30+
3. Create a new branch to focus on the specific change you are contributing e.g. `improv/logger-debug-sampling`
31+
4. Run all tests, and code baseline checks: `make pr`
32+
- Git hooks will run linting and formatting while `make pr` run deep checks that also run in the CI process
3533
4. Commit to your fork using clear commit messages.
36-
5. Send us a pull request, answering any default questions in the pull request interface.
34+
5. Send us a pull request with a [conventional semantic title](https://github.com/awslabs/aws-lambda-powertools-python/pull/67), and answering any default questions in the pull request interface.
3735
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3836

3937
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4038
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4139

40+
#### Local documentation
41+
42+
You might find useful to run both the documentation website and the API reference locally while contributing:
43+
44+
* **API reference**: `make docs-api-local`
45+
* **Docs website**: `make dev-docs` to install deps, and `make docs-local` to run it thereafter
46+
47+
### Conventions
48+
49+
Category | Convention
50+
------------------------------------------------- | ---------------------------------------------------------------------------------
51+
**Docstring** | We use a slight variation of numpy convention with markdown to help generate more readable API references.
52+
**Style guide** | We use black as well as flake8 extensions to enforce beyond good practices [PEP8](https://pep8.org/). We strive to make use of type annotation as much as possible, but don't overdo in creating custom types.
53+
**Core utilities** | Core utilities use a Class, always accept `service` as a constructor parameter, can work in isolation, and are also available in other languages implementation.
54+
**Utilities** | Utilities are not as strict as core and focus on solving a developer experience problem while following the project [Tenets](https://awslabs.github.io/aws-lambda-powertools-python/#tenets).
55+
**Exceptions** | Specific exceptions live within utilities themselves and use `Error` suffix e.g. `MetricUnitError`.
56+
**Git commits** | We follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). These are not enforced as we squash and merge PRs, but PR titles are enforced during CI.
57+
**Documentation** | API reference docs are generated from docstrings which should have Examples section to allow developers to have what they need within their own IDE. Documentation website covers the wider usage, tips, and strive to be concise.
4258

4359
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4560

61+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/help wanted/invalid/question/documentation), looking at any 'help wanted' issues is a great place to start.
4662

4763
## Code of Conduct
64+
4865
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4966
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5067
[email protected] with any additional questions or comments.
5168

52-
5369
## Security issue notifications
5470
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5571

example/hello_world/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def lambda_handler(event, context):
117117
metrics.add_metric(name="SuccessfulLocations", unit="Count", value=1)
118118
except requests.RequestException as e:
119119
# Send some context about this error to Lambda Logs
120-
logger.exception(e, exc_info=True)
120+
logger.exception(e)
121121
raise
122122

123123
with single_metric(name="UniqueMetricDimension", unit="Seconds", value=1) as metric:

0 commit comments

Comments
 (0)