forked from di-sukharev/opencommit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api.ts): solving bad request issue (di-sukharev#187)
* 2.0.18 * patch * 2.0.19 * style(.prettierrc): reorder properties to follow alphabetical order and improve readability * feat(generateCommitMessageFromGitDiff.ts): changing logic of MAX_REQ_TOKENS fix(api.ts): add missing import for GenerateCommitMessageErrorEnum The token count validation is added to prevent the request from exceeding the default model token limit. The validation is done by counting the tokens in each message and adding 4 to each count to account for the additional tokens added by the API. If the total token count exceeds the limit, an error is thrown. The missing import for GenerateCommitMessageErrorEnum is also added. feat: add support for splitting long line-diffs into smaller pieces This change adds support for splitting long line-diffs into smaller pieces to avoid exceeding the maximum commit message length. The `splitDiff` function splits a single line into multiple lines if it exceeds the maximum length. It also splits the diff into smaller pieces if adding the next line would exceed the maximum length. This change improves the readability of commit messages and makes them more consistent. refactor: improve code readability by adding whitespace and reformatting code This commit improves the readability of the code by adding whitespace and reformatting the code. The changes do not affect the functionality of the code. Additionally, a new function `delay` has been added to the file. --------- Co-authored-by: di-sukharev <dim.sukharev@gmail.com>
- Loading branch information
1 parent
4f57201
commit 32f3e17
Showing
3 changed files
with
171 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters