-
-
Notifications
You must be signed in to change notification settings - Fork 296
feat: add config option for line length warning #1574
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: v4-9-0-test
Are you sure you want to change the base?
feat: add config option for line length warning #1574
Conversation
…l sites of get_version
…nsors-readme-action@v1
Bumps [dawidd6/action-homebrew-bump-formula](https://github.com/dawidd6/action-homebrew-bump-formula) from 4 to 5. - [Release notes](https://github.com/dawidd6/action-homebrew-bump-formula/releases) - [Commits](dawidd6/action-homebrew-bump-formula@v4...v5) --- updated-dependencies: - dependency-name: dawidd6/action-homebrew-bump-formula dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
It was added in commitizen-tools#1070 but never documented AFAICT.
Sorry, I accidentally closed this pull request. |
let's rebase from |
9a2622f
to
c300b70
Compare
I have rebased my branch onto v4-9-0. |
You've done it perfectly 🙂 I'll take a look when bandwidth allow |
…th it Warn if a given decimal string is not in range
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! A few suggestion:
commitizen/commands/check.py
Outdated
raise CommitMessageLengthExceededError( | ||
f"commit validation: failed!\n" | ||
f"commit message length exceeds the limit.\n" | ||
f'commit "": "{commit_msg}"\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.
what does ""
mean 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.
I guess you forgot to put something like commit hash here in the error message
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.
You’re right. I referenced the error handling for invalid messages and forgot to add the commit hash. I’ll make the correction.
commitizen/defaults.py
Outdated
@@ -108,6 +109,7 @@ class Settings(TypedDict, total=False): | |||
"always_signoff": False, | |||
"template": None, # default provided by plugin | |||
"extras": {}, | |||
"message_length_limit": 0, # 0 for no limit |
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.
Why don't we just use None
for no limit?
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.
Initially, I set it to 0 simply because I thought commit messages wouldn't have a 0-character scenario, but your suggestion of using None is more clear. I've made this change accordingly.
…elated logic, types, and tests
…ecessary filter, use named tuple for options
Original "push" stage has been deprecated since pre-commit v3.2.0. See pre-commit/pre-commit#2732 and pre-commit/pre-commit#2808 for detailed information.
…ig function for readability
we might need to resolve the conflict first. Thanks! |
Description
This PR implements configuration file support for the
message_length_limit
option, addressing issue #1571 . Previously, users could only set commit message length limits via command-line arguments (-l/--message-length-limit
). Now they can define a default limit in their configuration file.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
Users can now set default commit message length limits in their configuration file:
Steps to Test This Pull Request
Additional Context