chore(ruff): adopt google docstring convention and enforce DOC102/DOC402#1184
Open
dgarros wants to merge 2 commits into
Open
chore(ruff): adopt google docstring convention and enforce DOC102/DOC402#1184dgarros wants to merge 2 commits into
dgarros wants to merge 2 commits into
Conversation
Set the pydocstyle convention to google so the DOC (pydoclint) rules parse Args/Returns/Yields sections correctly, which also cleared a batch of false-positive DOC201 findings. D203/D213/D401/D404 are now handled by the convention instead of manual ignores. Un-park and fix the docstring/signature-consistency rules DOC102 (extraneous parameter) and DOC402 (missing Yields): - client.py: document the streaming context managers' yields; rename the stale `size` param to the actual `prefix_length` - ctl/config.py: correct the `config_file` param name and descriptions - loader.py, test_repository.py: document generator yields D301 stays parked: converting to a raw string breaks Typer's `\b` no-wrap marker in CLI command docstrings.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## infrahub-develop #1184 +/- ##
====================================================
+ Coverage 82.49% 83.01% +0.51%
====================================================
Files 139 139
Lines 12210 12365 +155
Branches 1823 1846 +23
====================================================
+ Hits 10073 10265 +192
+ Misses 1576 1532 -44
- Partials 561 568 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 12 files with indirect coverage changes 🚀 New features to boost your workflow:
|
dgarros
marked this pull request as ready for review
July 16, 2026 04:23
Deploying infrahub-sdk-python with
|
| Latest commit: |
f176345
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a2594ac0.infrahub-sdk-python.pages.dev |
| Branch Preview URL: | https://dga-brain-doc-validate-jg0v6.infrahub-sdk-python.pages.dev |
polmichel
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The SDK's docstrings aren't verified against the code, so parameters, return/yield
sections, and descriptions can drift out of sync silently. We're turning on ruff's
D/DOC(pydocstyle + pydoclint) rules incrementally — this is the firstenforceable slice, focused on docstring-vs-signature accuracy.
Non-goals: clearing the large "missing docstring" (D10x) backlog — those stay
parked for later phases.
What changed
parameter that isn't in the signature) and DOC402 (a generator whose
yieldisn't documented).
google(matches the codebase). Beyondstyle, this lets the DOC rules correctly parse
Args/Returns/Yieldssections — which cleared ~35 false-positive DOC201 findings and let
D203/D213/D401/D404 drop from manual ignores.
sizeparam (actuallyprefix_length) and placeholder/incorrect param docs inConfiguredSettings,and documented the yields of the streaming HTTP context managers and two
generators.
\bno-wrap marker into literal text and break CLI--helpformatting.No runtime behavior changes — only docstrings, regenerated CLI/SDK reference docs,
and lint config.
How to test
Impact & rollout
convention = "google"; DOC102/DOC402 enforced going forward.Summary by cubic
Adopts the Google docstring convention in
ruffand enforces docstring/signature accuracy withDOC102andDOC402. Fixes mismatched params and adds missing Yields docs; no runtime changes.DOC102/DOC402in CI; keepD301ignored due to Typer\b.[tool.ruff.lint.pydocstyle].convention = "google"; drop manual ignores for D203/D213/D401/D404; trim redundant comments inpyproject.toml.infrahub_sdk.client: renamesizetoprefix_lengthin docs; addYieldsfor streaming (sync/async).infrahub_sdk/ctl/config.py: correct param name toconfig_file; clarifyconfig_data.Yieldsdocs for generators.prefix_length.Written for commit f176345. Summary will update on new commits.