rules: skip line-length rule for URLs and quoted lines#30
Merged
joyeecheung merged 3 commits intonodejs:masterfrom Nov 2, 2018
Merged
rules: skip line-length rule for URLs and quoted lines#30joyeecheung merged 3 commits intonodejs:masterfrom
joyeecheung merged 3 commits intonodejs:masterfrom
Conversation
richardlau
reviewed
Oct 13, 2018
lib/rules/line-length.js
Outdated
| var failed = false | ||
| for (let i = 0; i < parsed.body.length; i++) { | ||
| const line = parsed.body[i] | ||
| // Skip quoted lines, e.g. for riginal commit messages of V8 backports. |
lib/rules/line-length.js
Outdated
| if (line.startsWith(' ')) | ||
| continue | ||
| // Skip lines with URLs. | ||
| if (line.match(/https?:\/\//)) |
There was a problem hiding this comment.
I think RegExp#test would be better here.
Member
Author
There was a problem hiding this comment.
@thefourtheye There’s 0 difference here, right? Anyway, done!
There was a problem hiding this comment.
You are correct, there will be no difference. I was going for idiomatic code 🙂
lib/rules/line-length.js
Outdated
| for (let i = 0; i < parsed.body.length; i++) { | ||
| const line = parsed.body[i] | ||
| // Skip quoted lines, e.g. for original commit messages of V8 backports. | ||
| if (line.startsWith(' ')) |
There was a problem hiding this comment.
Shouldn't this have four space characters? The test actually tests with four space characters.
Member
Author
There was a problem hiding this comment.
I’m not sure … switched to 4 spaces for now, yes
thefourtheye
approved these changes
Oct 17, 2018
joyeecheung
approved these changes
Oct 17, 2018
Member
|
@thefourtheye, @joyeecheung, @addaleax I think this can be landed, isn't it? |
Member
|
@lundibundi Yes, I'll push the button |
richardlau
pushed a commit
to richardlau/core-validate-commit
that referenced
this pull request
Dec 15, 2018
richardlau
added a commit
to richardlau/core-validate-commit
that referenced
this pull request
Dec 15, 2018
2 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #24