Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add reference section to docs #231

Merged
merged 4 commits into from
Jul 8, 2023
Merged

Add reference section to docs #231

merged 4 commits into from
Jul 8, 2023

Conversation

empicano
Copy link
Owner

@empicano empicano commented Jul 8, 2023

I added Google-style docstrings to most of the classes to autogenerate a reference section in the docs (+ some smaller documentation tweaks). You can preview the docs as usual with ./scripts/setup && ./scripts/docs --reload. Happy to hear what you think!

@frederikaalund
Copy link
Collaborator

I like it. 😄👍 Think it'll make it easier to approach aiomqtt for newcomers. Good idea it document the function arguments directly in the docstrings. I know that some editors/IDEs (e.g., VS Code) use the docstrings to display a help message to the user. This will aid them. :)

I also like the explanations about context managers (contrasted to connect/disconnect). This is probably what confuses most people about aiomqtt. Good that you mentioned the workarounds (direct calls to aenter/aexit) in there. That enables our users to use the old-style approach but their linter will shout at them if they have one (because they call dunder methods). :)

Thanks for yet another great contribution to aiomqtt! 👍

@JonathanPlasse
Copy link
Collaborator

You should update ruff.pydocstyle.convention in pyproject.toml to google.
By doing this it found 3 rule violations:

aiomqtt/client.py:540:15: D417 Missing argument descriptions in the docstring: `**kwargs`, `*args`, `properties`
aiomqtt/client.py:575:15: D417 Missing argument descriptions in the docstring: `**kwargs`, `*args`
aiomqtt/client.py:602:15: D417 Missing argument descriptions in the docstring: `**kwargs`, `*args`
Found 3 errors.

@empicano
Copy link
Owner Author

empicano commented Jul 8, 2023

Wow, that's cool that ruff can check that. Great tip! 👍

@empicano empicano merged commit 8b8ee3b into main Jul 8, 2023
@empicano empicano deleted the reference branch July 8, 2023 22:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants