Skip to content

Commit b727a0a

Browse files
authored
Enforce ruff docstring validation and fix issues (#1868)
* Apply ruff * Fix first docstrings * Additional docstring fixes * Improve AGENTS.md * Enhance documentation across the pyoverkiz package - Added module-level docstrings to various files including enums, models, and utilities to improve clarity and understanding of their purpose. - Updated existing classes and methods with detailed docstrings to describe their functionality and usage. - Improved test files with descriptive docstrings to clarify the purpose of each test case. - Refactored some code for better readability and maintainability. * Revert unneeded changes
1 parent 26423ac commit b727a0a

27 files changed

Lines changed: 337 additions & 112 deletions

AGENTS.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,6 @@ Always use full type annotations, generics, and other modern practices.
9191
- For longer tests put them in a file like `tests/test_somename.py` in the `tests/`
9292
directory (or `tests/module_name/test_somename.py` file for a submodule).
9393

94-
- For simple tests, prefer inline functions in the original code file below a `## Tests`
95-
comment. This keeps the tests easy to maintain and close to the code.
96-
Inline tests should NOT import pytest or pytest fixtures as we do not want runtime
97-
dependency on pytest.
98-
99-
- DO NOT write one-off test code in extra files that are throwaway.
100-
101-
- DO NOT put `if __name__ == "__main__":` just for quick testing.
102-
Instead use the inline function tests and run them with `uv run pytest`.
103-
104-
- You can run such individual tests with `uv run pytest -s src/.../path/to/test`
105-
10694
- Don’t add docs to assertions unless it’s not obvious what they’re checking - the
10795
assertion appears in the stack trace.
10896
Do NOT write `assert x == 5, "x should be 5"`. Do NOT write `assert x == 5 # Check if
@@ -165,6 +153,8 @@ Always use full type annotations, generics, and other modern practices.
165153

166154
## Guidelines for Docstrings
167155

156+
- Every method (or function) should have a docstring.
157+
168158
- Here is an example of the correct style for docstrings:
169159
```python
170160
def check_if_url(

pyoverkiz/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Async wrapper for the Overkiz (TaHoma) API.
2+
3+
This package provides models, enums and a client to communicate with the
4+
Overkiz cloud and local gateway APIs.
5+
"""

0 commit comments

Comments
 (0)