Skip to content

refactor(questions): type questions with TypedDict #1485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025

Conversation

bearomorphism
Copy link
Contributor

@bearomorphism bearomorphism commented May 31, 2025

Description

A better version of #1467

Make the type of questions more strict. Not sure whether we should deprecate the type Questions.

Checklist

Code Changes

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run poetry doc locally to ensure the documentation pages renders correctly
    • Check if there are any broken links in the documentation

When running poetry doc, any broken internal documentation links will be reported in the console output like this:

INFO    -  Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'.

Expected Behavior

Steps to Test This Pull Request

Additional Context

Copy link

codecov bot commented May 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.88%. Comparing base (a9cd957) to head (f18342b).
Report is 7 commits behind head on refactors.

Additional details and impacted files
@@              Coverage Diff              @@
##           refactors    #1485      +/-   ##
=============================================
+ Coverage      97.87%   97.88%   +0.01%     
=============================================
  Files             57       58       +1     
  Lines           2677     2700      +23     
=============================================
+ Hits            2620     2643      +23     
  Misses            57       57              
Flag Coverage Δ
unittests 97.88% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# Type
Questions = Iterable[MutableMapping[str, Any]]
Questions = Iterable[MutableMapping[str, Any]] # TODO: deprecate this?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good; respond to one of your questions. Let me know if you want to address it in this PR or the next. Thanks!

@Lee-W Lee-W added pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check and removed pr-status: wait-for-review labels Jun 8, 2025
@Lee-W Lee-W force-pushed the refactors branch 2 times, most recently from baee83e to a9cd957 Compare June 8, 2025 13:31
@Lee-W Lee-W merged commit 626e67c into commitizen-tools:refactors Jun 8, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: ready-to-merge almost ready to merge. just keep it for a few days for others to check pr-status: wait-for-review type: refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants