Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(init): code cleanup and better test coverage #1424

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

Closed

Conversation

Copy link
Contributor

@bearomorphism bearomorphism commented May 17, 2025
edited
Loading

Description

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

Expected Behavior

Steps to Test This Pull Request

Additional Context

Copy link

codecov bot commented May 17, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.41%. Comparing base (a9cd957) to head (233b55d).

Additional details and impacted files
@@ Coverage Diff @@
## refactors #1424 +/- ##
=============================================
+ Coverage 97.87% 98.41% +0.54% 
=============================================
 Files 57 57 
 Lines 2677 2656 -21 
=============================================
- Hits 2620 2614 -6 
+ Misses 57 42 -15 
Flag Coverage Δ
unittests 98.41% <100.00%> (+0.54%) ⬆️

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.

check_pre_commit_config([CZ_HOOK_CONFIG])


class TestNoPreCommitInstalled:
Copy link
Contributor Author

@bearomorphism bearomorphism May 17, 2025

Choose a reason for hiding this comment

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

test_pre_commit_not_installed is not working as expected...

'version = "0.0.1"\n'
"update_changelog_on_bump = true\n"
"major_version_zero = true\n"
'version = "0.0.1"\n'
Copy link
Contributor Author

@bearomorphism bearomorphism May 17, 2025

Choose a reason for hiding this comment

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

Does the order of these configs matter here?

Copy link
Member

Choose a reason for hiding this comment

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

Nop

bearomorphism reacted with thumbs up emoji
Copy link
Contributor Author

@bearomorphism bearomorphism May 18, 2025

Choose a reason for hiding this comment

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

Thanks.

def _ask_version_provider(self) -> str:
"""Ask for setting: version_provider"""

OPTS = {
Copy link
Member

Choose a reason for hiding this comment

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

Ideally, the VersionProvider ABC class should include identifier and description. Which would allow us to do something like

providers = metadata.entry_points(group=PROVIDER_ENTRYPOINT)
{provider.identifier: provider.description for provider in providers} 

This way, custom user made providers would also appear in the init functions.


Just to be clear, this is optional, I hardcoded them here because it would help 90% of the users and I didn't want to go further.

bearomorphism reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@woile woile woile left review comments

@Lee-W Lee-W Awaiting requested review from Lee-W

@noirbizarre noirbizarre Awaiting requested review from noirbizarre

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /