Skip to content
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

feat: add argument to limit length of commit message in checks #1178

Merged

Conversation

jwidauer
Copy link
Contributor

@jwidauer jwidauer commented Jul 9, 2024

Description

Recently there was an addition to add a message length limit in #1076.
However, those changes only applied to the cz commit command.
This PR also adds this new command line argument to the cz check command, to make checking for these violations possible.

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

When running cz check -l N -m MESSAGE with N being greater than the length of the header of MESSAGE, the check should fail.

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.60%. Comparing base (120d514) to head (13334a6).
Report is 372 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1178      +/-   ##
==========================================
+ Coverage   97.33%   97.60%   +0.26%     
==========================================
  Files          42       55      +13     
  Lines        2104     2502     +398     
==========================================
+ Hits         2048     2442     +394     
- Misses         56       60       +4     
Flag Coverage Δ
unittests 97.60% <100.00%> (+0.26%) ⬆️

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.

@jwidauer jwidauer force-pushed the add-commit-message-length-check branch from c0cffd6 to 13334a6 Compare July 10, 2024 07:09
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.

@jwidauer This is great! Thanks for adding this. I'm planning to merge it these days so that others would have a chance to take a look.

@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 Jul 11, 2024
@Lee-W Lee-W merged commit be744f9 into commitizen-tools:master Jul 17, 2024
18 checks passed
@jwidauer jwidauer deleted the add-commit-message-length-check branch July 18, 2024 07:57
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants