Skip to content

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

Closed
26 tasks done
michaelbrewer opened this issue Mar 7, 2022 · 8 comments
Labels
documentation Improvements or additions to documentation

Comments

@michaelbrewer
Copy link
Contributor

michaelbrewer commented Mar 7, 2022

Is your feature request related to a problem? Please describe.

Describe 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

List of open pull requests

Originally part of a simple PR #1065 but now split up into smaller ones

@michaelbrewer michaelbrewer added feature-request feature request triage Pending triage from maintainers labels Mar 7, 2022
@michaelbrewer
Copy link
Contributor Author

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.

michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 12, 2022
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
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 12, 2022
Changes:
- Extract examples for batch
- Fix python syntax
- Fix yaml synxtax

Related to
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Format with isort and black
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort, black
- Fix yaml examples
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Fix python and yaml files
- Run isort and black
- Add make task

Closes:
- aws-powertools#1069

Related:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort, black
- Correct line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix yaml and python syntax
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort, black
- Fix python syntax errors
- Fix line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix python syntax errors
- Update line high lights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix python and yaml examples
- Update line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Update line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix python examples
- Update line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix python code examples
- Update line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
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
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code example
- Run isort and black
- Update line highlight
- Add make task for formatting and linting

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 13, 2022
Changes:
- Extract code examples
- Run isort and black
- Fix python syntax errors
- Update line highlights
- Add make task

Related to:
- aws-powertools#1064
michaelbrewer added a commit to gyft/aws-lambda-powertools-python that referenced this issue Apr 21, 2022
Changes:
- Extract code examples
- Run isort and black
- Update line highlights
- Add make task to format and lint examples

Related to:
- aws-powertools#1064
@michaelbrewer michaelbrewer changed the title docs: Move code snippets into dedicated python files docs: Move code snippets and fix errors into dedicated python files Apr 21, 2022
@michaelbrewer michaelbrewer changed the title docs: Move code snippets and fix errors into dedicated python files docs: Move code snippets into dedicated python files add formatting and linting, fixing any outstanding errors Apr 23, 2022
@michaelbrewer
Copy link
Contributor Author

@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 (isort, black), check for syntax error (py_compile) and perform linting (cfn-lint etc..).

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.

@sthulb
Copy link
Contributor

sthulb commented Apr 23, 2022

The pull requests associated with this issue will be resolved eventually. There’s a lot of them and they’re quite large too.

@michaelbrewer
Copy link
Contributor Author

Yep and covers 25 error in the docs too

@heitorlessa heitorlessa added documentation Improvements or additions to documentation and removed feature-request feature request labels Apr 26, 2022
@michaelbrewer
Copy link
Contributor Author

Updated preview of fixed docs is hosted here: https://gyft.github.io/aws-lambda-powertools-python/latest/

Up to version 1.25.10

@michaelbrewer
Copy link
Contributor Author

@sthulb i have adding all of the missing bug reports for syntax errors identified from this task.

@michaelbrewer michaelbrewer changed the title docs: Move code snippets into dedicated python files add formatting and linting, fixing any outstanding errors Docs: Move code snippets into dedicated python files add formatting and linting, fixing any outstanding errors May 17, 2022
@michaelbrewer
Copy link
Contributor Author

Updated preview of fixed docs is hosted here: gyft.github.io/aws-lambda-powertools-python/latest

Up to version 1.26.1

@sthulb sthulb closed this as completed Jun 14, 2022
@github-actions
Copy link
Contributor

Comments on closed issues are hard for our team to see.

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants