You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: fix 36 docstring quality gate failures across 17 files
- Fix missing_param_type, missing_return_type, param_type_mismatch,
return_type_mismatch, no_args, no_returns, and missing docstring issues
- Add TYPE_CHECKING imports for HuggingFace types in util.py with
type: ignore[union-attr] for pre-existing None-safety gaps
- Add Granite3ChatCompletion import to granite32/33 input.py for
correct sanitize() parent signature match
- Convert reST-style docstrings to Google style in intrinsics/input.py
- Document AST single-quote normalization for Literal types in
CONTRIBUTING.md
Copy file name to clipboardExpand all lines: docs/docs/guide/CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -391,7 +391,7 @@ in the table below, follow the fix instructions, and re-push.
391
391
|`no_raises`| Function source contains `raise` but the docstring has no `Raises:` section | Add a `Raises:` section listing each exception type and the condition that triggers it |
392
392
|`missing_param_type`|`Args:` section exists but one or more parameters have no Python type annotation — the type column is absent from the generated API docs | Add a type annotation to each listed parameter in the function signature (e.g. `def f(x: int)`). Only fires when `no_args` is already satisfied; `*args`/`**kwargs` are excluded. |
393
393
|`missing_return_type`|`Returns:` section is documented but the function has no return type annotation — the return type is absent from the generated API docs | Add a return annotation to the function signature (e.g. `-> str`). Only fires when `no_returns` is already satisfied. |
394
-
|`param_type_mismatch`| A parameter's `Args:` entry states an explicit type (e.g. `x (int): …`) that does not match the Python annotation in the function signature | Align the docstring type with the annotation, or vice versa. The check normalises common equivalents (`Optional[X]` ↔ `X \| None`, `List` ↔ `list`, union ordering) before comparing, so only genuine disagreements are flagged. Only fires when both the docstring and the signature have an explicit type. |
394
+
|`param_type_mismatch`| A parameter's `Args:` entry states an explicit type (e.g. `x (int): …`) that does not match the Python annotation in the function signature | Align the docstring type with the annotation, or vice versa. The check normalises common equivalents (`Optional[X]` ↔ `X \| None`, `List` ↔ `list`, union ordering) before comparing, so only genuine disagreements are flagged. Only fires when both the docstring and the signature have an explicit type. **Note:** Python's AST normalises string literals to single quotes, so `Literal["a", "b"]` in source is read as `Literal['a', 'b']` — use single quotes in docstrings to match. |
395
395
|`return_type_mismatch`| The `Returns:` section has a type prefix (e.g. `Returns: \n str: …`) that does not match the Python return annotation | Align the docstring return type with the annotation, or vice versa. Same normalisation rules as `param_type_mismatch`. Only fires when both sides have an explicit type. |
0 commit comments