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: regex headerPattern for eslint #268

Merged
merged 1 commit into from
Jan 15, 2018

Conversation

JPeer264
Copy link
Contributor

@JPeer264 JPeer264 commented Jan 8, 2018

The previous regex got a lot of overhead. The new one is easier to read and faster to parse.

But here I changed the regex a bit. First it also matched whitespaces in the beginning of the message, now it doesnt. If the same behavior is wished, I can change the regex to:

 /^(\w*): (.*)$/

Which does the same as the original one, but with less overhead

@stevemao
Copy link
Member

stevemao commented Jan 8, 2018

Can you add a test?

@JPeer264
Copy link
Contributor Author

JPeer264 commented Jan 9, 2018

I added a test case with the beginning trailing whitespaces. Did you mean this test case?

Copy link
Member

@stevemao stevemao left a comment

Choose a reason for hiding this comment

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

I don't mind this change. Any opposition?

@hutson
Copy link
Contributor

hutson commented Jan 14, 2018

👍 I'm fine with this change.

I will note that I couldn't actually find any ESLint documentation on whether commit messages are allowed to contain spaces after the commit type and colon.

Their documention does say one way or the other.

@stevemao should this be a breaking change since the whitespace behavior has changed?

@JPeer264
Copy link
Contributor Author

JPeer264 commented Jan 14, 2018

I would see this as breaking change, since this update won't apply to the previous style. Also a fix wouldn't fit, 'cause the lib was never thought to be that way.

@stevemao
Copy link
Member

@JPeer264 ok. Thanks! Could you squash and change the commit message to follow our standard? Make sure you have a BREAKING CHANGE: in it.

@JPeer264
Copy link
Contributor Author

like this?

BREAKING CHANGE:
Trailing whitespaces at the beginning of commit messages
will not be saved anymore
@JPeer264 JPeer264 changed the title Update: regex headerPattern for eslint feat: regex headerPattern for eslint Jan 15, 2018
@stevemao stevemao merged commit ccc1365 into conventional-changelog:master Jan 15, 2018
@JPeer264 JPeer264 deleted the patch-2 branch January 16, 2018 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants