Skip to content

Conversation

@bearomorphism
Copy link
Collaborator

@bearomorphism bearomorphism commented Jan 31, 2026

Follow up of #1825

Better test coverage for the change and renamed some variables and methods.

@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.98%. Comparing base (3c546bd) to head (ac05276).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff              @@
##           next-release    #1829   +/-   ##
=============================================
  Coverage         97.98%   97.98%           
=============================================
  Files                60       60           
  Lines              2682     2682           
=============================================
  Hits               2628     2628           
  Misses               54       54           

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

try:
# TODO(bearomorphism): can we get the description from the cz class without initiating an instance?
cz_obj = cz_class(self.config)
except MissingCzCustomizeConfigError:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I'm not sure whether this is compatible with plugins. Should we use general exception?

wdyt @Lee-W

Copy link
Member

Choose a reason for hiding this comment

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

why do you think it might not be compatible

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought other plugins throw other exceptions when they initialize with empty config, but we actually always initialize that with a BaseConfig object.

choices = []
for cz_name, cz_class in registry.items():
try:
# TODO(bearomorphism): can we get the description from the cz class without initiating an instance?
Copy link
Member

Choose a reason for hiding this comment

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

need to make it a class of static method, as we need to take config as an argument, it's not likely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

try:
# TODO(bearomorphism): can we get the description from the cz class without initiating an instance?
cz_obj = cz_class(self.config)
except MissingCzCustomizeConfigError:
Copy link
Member

Choose a reason for hiding this comment

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

why do you think it might not be compatible

# TODO(bearomorphism): can we get the description from the cz class without initiating an instance?
cz_obj = cz_class(self.config)
except MissingCzCustomizeConfigError:
# workaround for cz_customize
Copy link
Member

Choose a reason for hiding this comment

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

why is it a workaround for cz_customize? I thought it's for non-core czs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

do non-core czs throw MissingCzCustomizeConfigError? I am not familiar with it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I understood it correctly, only CzCustomize throws the error

continue
first_example = cz_obj.schema().partition("\n")[0]

# Get the first line of the schema as the description
Copy link
Member

Choose a reason for hiding this comment

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

we'd better add a description in v5. schema looks like a workaround for me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it does not have to be a v5 feature. We can make description optional.

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.

3 participants