Improve docstrings for Hooks

Open
#269 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Start by locating the public hook interfaces, including HookContext, in the cloudformation_cli_python_lib package, then compare them with the generated ../handlers.py example and the Implement Hook handlers (Python) documentation. Review how request.hookContext and targetModel are exposed. Done means the relevant public classes and properties have useful Python docstrings that explain their meaning and expected values.

Written by the indexing model from the issue text.

Description

Hi there 👋,

It would be nice to have Python docstrings included on the public interfaces when developing hooks.
Would pull requests for docstrings be welcome?

For example, after cfn init for hooks, we have a ../handlers.py that looks similar to this:
image

In Visual Studio Code, when I hover over cloudformation_cli_python_lib specific classes/properties I don't get any information for what they are, or what to expect.

I couldn't find out what all the request.hookContext properties mean, and what dict keys are available on request.hookContext.targetModel from the Implement Hook handlers (Python) documentation.

In the case of HookContext some docstrings like this would be welcome:
image

Cheers,
Neil

Dominant language
Python
Stars
107
Forks
46
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws-cloudformation/cloudformation-cli-python-plugin

All issues in aws-cloudformation/cloudformation-cli-python-plugin

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.