Skip to content

Doc-strings: 'Optional, ' exactly for the parameters with a default - #545

Merged
Paebbels merged 1 commit into
devfrom
claude/optional-parameter-docs
Oct 11, 2026
Merged

Paebbels merged 1 commit into
devfrom
claude/optional-parameter-docs

Conversation

@pytooling-claude

Copy link
Copy Markdown

Documentation

  • A parameter's :param: description opens with Optional, exactly when the parameter has a default value, as
    the coding guide asks (python3 CheckDocstrings.py --check optional pyTooling: 81 → 0).
    • 25 parameters with a default gained it: the exc_type/exc_val/exc_tb parameters of seven __exit__
      methods, dest of the three ArgParse flags, kind of Graph.BaseEdge. The rest of the sentence starts in lower
      case; "Exception type" and "Exception instance" got the missing period.
    • 56 parameters without a default lost it, mostly ones annotated Nullable[...]: they accept None, but must be
      passed. The sentence now starts in upper case.
    • StringEnum.Parse's value named a default (Default: ``None``.) it doesn't have; removed.
    • Columns stay aligned; the three dest lines were rewrapped (127 columns otherwise).
  • doc/News.rst: an entry in v10's Documentation.
Module Sites
pyTooling.Graph 11
pyTooling.Warning 10
pyTooling.Packaging 9
pyTooling.Filesystem 6
pyTooling.Stopwatch 6
pyTooling.Tracing 6
pyTooling.Graph.GraphML 5
pyTooling.Common 4
pyTooling.Dependency.Python 4
pyTooling.MetaClasses 4
pyTooling.Versioning 4
pyTooling.Attributes.ArgParse (Flag, KeyValueFlag, OptionalValuedFlag) 3
pyTooling.Tree 3
pyTooling.TerminalUI 2
pyTooling.CLIAbstraction, pyTooling.Exceptions, pyTooling.GenericPath, pyTooling.GenericPath.URL 1 each

Tests

  • CheckDocstrings.py --check optional pyTooling: 0 problems (was 81); the default checks (params, fields, returns,
    summary): 0.
  • CheckAlignment.py, CheckFieldComments.py, CheckBlankLines.py, CheckProperties.py, CheckAnnotations.py: 0;
    CheckRaises.py: 18 hints, unchanged.
  • pytest tests/unit: 2511 passed, 31 skipped, 3 xfailed.

Related Issues and Pull-Requests

A parameter's ':param:' description opens with 'Optional, ' if and only
if the parameter has a default value, as the coding guide asks:

* 25 parameters with a default gained it: the '__exit__' parameters of
  the context managers, 'dest' of the three ArgParse flags, 'kind' of
  'BaseEdge'.
* 56 parameters without a default lost it, mostly ones annotated
  'Nullable[...]': they accept None, but must be passed.

'StringEnum.Parse' named a default ('None') its 'value' doesn't have.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude
pytooling-claude Bot requested a review from Paebbels as a code owner October 11, 2026 23:02
@pytooling-claude pytooling-claude Bot added Documentation Improvements or additions to documentation Quality: Doc Documentation quality: completeness, coverage, level of details labels Oct 11, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Paebbels
Paebbels merged commit 3a9f15c into dev Oct 11, 2026
24 of 40 checks passed
@Paebbels
Paebbels deleted the claude/optional-parameter-docs branch October 11, 2026 23:09
This was referenced Oct 12, 2026
This was referenced Oct 20, 2026
@pytooling-claude pytooling-claude Bot added this to the v10.0 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Quality: Doc Documentation quality: completeness, coverage, level of details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants