-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
base: master
Are you sure you want to change the base?
refactor(init): code cleanup and better test coverage #1424
Conversation
b3d3048
to
a36b7ef
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1424 +/- ##
==========================================
+ Coverage 97.33% 98.12% +0.78%
==========================================
Files 42 57 +15
Lines 2104 2661 +557
==========================================
+ Hits 2048 2611 +563
+ Misses 56 50 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
commands.Init(config)() | ||
check_cz_config(default_choice) | ||
# check that config is not duplicated | ||
check_pre_commit_config([cz_hook_config]) | ||
check_pre_commit_config([CZ_HOOK_CONFIG]) | ||
|
||
|
||
class TestNoPreCommitInstalled: |
There was a problem hiding this comment.
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...
"update_changelog_on_bump = true\n" | ||
"major_version_zero = true\n" | ||
'version = "0.0.1"\n' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
if not tag_format: | ||
tag_format = default_format | ||
return tag_format | ||
return tag_format or default_format | ||
|
||
def _ask_version_provider(self) -> str: | ||
"""Ask for setting: version_provider""" | ||
|
||
OPTS = { |
There was a problem hiding this comment.
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.
Description
Checklist
Code Changes
poetry all
locally to ensure this change passes linter check and testsDocumentation Changes
poetry doc
locally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Additional Context