style: satisfy docstring and complexity gates in the sync script - #57
Merged
Conversation
The code quality gate runs pydocstyle with no convention selected, so the Google-style "Args:"/"Returns:" sections ruff accepted are rejected there: it wants NumPy sections with dashed underlines (D406/D407), a summary starting on the second line (D213) and a blank line closing the last section (D413). Converts every docstring to NumPy style, which both gates accept, and splits main() so its cyclomatic complexity drops from 16 to 7 -- the gate caps it at 15. load_project() and resolve() now own the file reading and the floor arithmetic, and changes() owns the bullet list that describe() used to build inline. Also drops typing.Any for the real tomlkit types, which ANN401 disallows, and introduces the Floors and Resolved aliases so the signatures stay inside 80 columns. That last point matters: sdepack sets no line-length so it formats at 88, and a signature wrapped for 80 gets rejoined at 88, so the two formatters would disagree forever. Behaviour is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.



The code quality gate flags 45 issues in
.github/scripts/sync_python_versions.py, all introduced with that script. This fixes them; behaviour is unchanged.Docstrings (44 issues). The gate runs pydocstyle with no convention selected, so it wants NumPy sections — dashed underlines (
D407), section names without a trailing colon (D406), a summary starting on the second line (D213) and a blank line closing the last section (D413). Ruff'sDOCrules accepted the Google-styleArgs:/Returns:form, so this was invisible to the CI lint job. Every docstring is now NumPy style, which both gates accept.Complexity (1 issue).
main()was at cyclomatic complexity 16 against a limit of 15. Split intoload_project()(file reading),resolve()(floor arithmetic) andchanges()(the bullet listdescribe()built inline);main()is now 7, and the file's worst function is 13.Also replaces
typing.Anywith the real tomlkit types, whichANN401disallows, usingFloors/Resolvedaliases to keep signatures inside 80 columns —sdepacksets noline-lengthand so formats at 88, and a signature wrapped for 80 is rejoined at 88, which would leave the two formatters permanently disagreeing.Verified: pydocstyle clean, ruff lint and
format --checkclean against all 13 repo configs, max complexity 13, and the full behaviour battery re-run (no-op when in sync, Python 4/5 major-line replacement, floor never lowered, quote style preserved, valid TOML).🤖 Generated with Claude Code