-
Notifications
You must be signed in to change notification settings - Fork 420
Docs: Move code snippets into dedicated python files add formatting and linting, fixing any outstanding errors #1064
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
Comments
I have a pull request that partially fixes this (as there is a lot of examples to migrate). So once there is feedback on this I can continue. |
Changes: - Extract all code examples - Fix yaml, terraform and python - Add make file to format, lint and validate examples Related to - aws-powertools#1064 Fixed - aws-powertools#1067 - aws-powertools#1069
Changes: - Extract examples for batch - Fix python syntax - Fix yaml synxtax Related to - aws-powertools#1064
Changes: - Extract code examples - Format with isort and black - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort, black - Fix yaml examples - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Fix python and yaml files - Run isort and black - Add make task Closes: - aws-powertools#1069 Related: - aws-powertools#1064
Changes: - Extract code examples - Run isort, black - Correct line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix yaml and python syntax - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort, black - Fix python syntax errors - Fix line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix python syntax errors - Update line high lights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix python and yaml examples - Update line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Update line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix python examples - Update line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix python code examples - Update line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Update line highlights - Open external links in new tab - Add make task Related to: - aws-powertools#1064
Changes: - Extract code example - Run isort and black - Update line highlight - Add make task for formatting and linting Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Fix python syntax errors - Update line highlights - Add make task Related to: - aws-powertools#1064
Changes: - Extract code examples - Run isort and black - Update line highlights - Add make task to format and lint examples Related to: - aws-powertools#1064
@heitorlessa @sthulb - as part of the original papercuts, we had discuss how many errors we have fund in the code examples, and that extracting them into separate files would allow us to add formatting ( So in a series of pull requests, i have extracted and fixes all of the code examples (python, terraform and sam templates) and fixed (over 25 errors so far). Some of these pull requests has quite a few errors and some just have smaller formatting inconsistencies. |
The pull requests associated with this issue will be resolved eventually. There’s a lot of them and they’re quite large too. |
Yep and covers 25 error in the docs too |
Updated preview of fixed docs is hosted here: https://gyft.github.io/aws-lambda-powertools-python/latest/ Up to version |
@sthulb i have adding all of the missing bug reports for syntax errors identified from this task. |
Updated preview of fixed docs is hosted here: gyft.github.io/aws-lambda-powertools-python/latest Up to version |
Comments on closed issues are hard for our team to see. |
Is your feature request related to a problem? Please describe.
custom_jmespath_function.py
#1214Cloning Logger config to all other registered standard loggers
example has errors #1215Exception not affecting idempotency record sample
example has python syntax errors #1216Reusing a DynamoDB table that uses a composite primary key
example #1217response.json
in fined grained responses not formatted correctly #1223Additional context
for a summaryDescribe the solution you'd like
In the past there was many documentation errors found like #1004 , on a regular basis i would try to help the
community by verifying the code examples, that they can compile, linted, valid formatting and had the correct line highlights
As part of general papercuts #857 and then later #1009 it was decided to split up the examples into separate files so that they can be linted or validates.
Currently the AWS Lambda Documentation has many typos, syntax errors, missing imports, invalid yaml indentation and terraform errors (about 25 errors currently and we keeping on running into this errors each time code examples are updated or added (see #1004). Here is a list of some of them as separate issues:
Hosted version of this is at: https://gyft.github.io/aws-lambda-powertools-python/latest/
Describe alternatives you've considered
Keeping the examples inside the markdown docs. But we run into issues like below, where errors are not easily picked up
Additional context
As a side effect many existing errors will be resolved AND measures put in to prevent them from happening again. Here is a list of errors currently in the documentation
Lambda Layer - Terraform
exampleSAR - CDK
examplesExample: Least-privileged IAM permissions to deploy Layer
exampleCloning Logger config to all other registered standard loggers
which results in a errorAttributeError: module 'logging' has no attribute 'logger'
on line 8template.yml
indentsAssert multiple EMF blobs with pytest
exampleCreating a S3 Provider to fetch parameters
exampleAccessing processed messages via context manager
example removing unused imports and fix line highlights.Extending failure handling mechanism in BatchProcessor
examplesuccess_handler
Batch - Creating a custom batch processor exampleCustomizing boto configuration
examplevalidator_function.py
example, see Validation - Validate functionEventBridge Envelope
exampleAWS Serverless Application Model (SAM) example
Exception not affecting idempotency record sample
exampleReusing a DynamoDB table that uses a composite primary key
exampleUsing Idempotency with JSONSchema Validation utility
exampleDeserializing JSON before using as idempotency key
example in JMESPath Functions - page - Missing importcustom_jmespath_function.py
example in JMESPath Functions - page - Invalid python syntaxList of open pull requests
Originally part of a simple PR #1065 but now split up into smaller ones
The text was updated successfully, but these errors were encountered: