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: update wrap functionality #104

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dmitry-prohorov
Copy link

@dmitry-prohorov dmitry-prohorov commented Nov 10, 2019

Hi,

Thank you for this amazing tool!

When I try to use this tool and describe my body with breaklineChar feature I've faced trouble. You are wrapping the entire body into 100 characters lines and after that add break lines. So if I type 1. update description|2. add commit message format section|3. add docker section|4. add commit helper tool section into the body I will see next result (which is not expected)

###--------------------------------------------------------###
docs: update docs

1. update description
2. add commit message format section
3. add docker section
4. add commit
helper tool section
###--------------------------------------------------------###

But I want to see

###--------------------------------------------------------###
docs: update docs

1. update description
2. add commit message format section
3. add docker section
4. add commit helper tool section
###--------------------------------------------------------###

In latest node versions
fs.write(fd, string[, position[, encoding]], callback)
The callback parameter is no longer optional. Not passing it will throw a TypeError at runtime.
Wrap only separate lines with 100 character limit
Copy link
Member

@leonardoanalista leonardoanalista left a comment

Choose a reason for hiding this comment

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

awesome! lgtm, we merge when test passes. Please commit as a fix too. 👏 👏 👏

@@ -32,18 +34,35 @@ const addType = (type, config) => {
return _.trim(`${prefix}${type}${suffix}`);
};

const addBreaklinesIfNeeded = (value, breaklineChar = defaultBreaklineChar) =>
value
const addBreaklinesIfNeededAndWrap = (value = '', config) => {
Copy link
Member

Choose a reason for hiding this comment

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

that sounds perfect to me! thanks for the fix!

@dmitry-prohorov
Copy link
Author

@leonardoanalista done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants