-
Notifications
You must be signed in to change notification settings - Fork 51
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
rules: skip line-length rule for URLs and quoted lines #30
Conversation
lib/rules/line-length.js
Outdated
@@ -31,6 +31,12 @@ module.exports = { | |||
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. |
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.
riginal
->original
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.
@richardlau thanks, done!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think RegExp#test would be better 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.
@thefourtheye There’s 0 difference here, right? Anyway, done!
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 are correct, there will be no difference. I was going for idiomatic code 🙂
lib/rules/line-length.js
Outdated
@@ -31,6 +31,12 @@ module.exports = { | |||
var failed = false | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this have four space characters? The test actually tests with four space characters.
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’m not sure … switched to 4 spaces for now, yes
@thefourtheye, @joyeecheung, @addaleax I think this can be landed, isn't it? |
@lundibundi Yes, I'll push the button |
Fixes: #24