Skip to content

fix(types): correct nullability of config fields in command TypedDicts#1952

Draft
bearomorphism wants to merge 1 commit intomasterfrom
fix/config-nullability-types
Draft

fix(types): correct nullability of config fields in command TypedDicts#1952
bearomorphism wants to merge 1 commit intomasterfrom
fix/config-nullability-types

Conversation

@bearomorphism
Copy link
Copy Markdown
Collaborator

Description

Several command TypedDicts declared fields as non-nullable (int, str, dict, list) while argparse produces None when CLI flags are omitted. Runtime code already handles None correctly (via or fallbacks, .get(), explicit None checks), but the type annotations were misleading to both developers and mypy.

Changes

  • CommitArgs: message_length_limit: intint | None
  • CheckArgs: message_length_limit: intint | None, allowed_prefixes: list[str]list[str] | None
  • BumpArgs: file_name: strstr | None
  • ChangelogArgs: file_name, start_rev, tag_format, version_scheme, export_template, template → add | None; extrasdict[str, Any] | None

Scope

Type annotations only — no behavioral changes.

Related

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-with: GitHub Copilot CLI following the guidelines

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes
  • Update the documentation for the changes

No test or doc changes needed — this is a pure type annotation fix with no behavioral impact.

Several command TypedDicts declared fields as non-nullable (int, str,
dict, list) while argparse produces None when CLI flags are omitted.
Runtime code already handles None correctly, but the type annotations
were misleading.

Changes:
- CommitArgs: message_length_limit int -> int | None
- CheckArgs: message_length_limit int -> int | None,
  allowed_prefixes list[str] -> list[str] | None
- BumpArgs: file_name str -> str | None
- ChangelogArgs: file_name, start_rev, tag_format, version_scheme,
  export_template, template str -> str | None;
  extras dict[str, Any] -> dict[str, Any] | None

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (4b93a50) to head (bef33f7).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1952   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files          61       61           
  Lines        2779     2779           
=======================================
  Hits         2730     2730           
  Misses         49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant