FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lint: wrap lines which include RegEx exceeding 80 chars by thelostone-mc · Pull Request #14607 · nodejs/node · GitHub

/ node Public

lint: wrap lines which include RegEx exceeding 80 chars - #14607

Closed
thelostone-mc wants to merge 1 commit into
nodejs:masterfrom
thelostone-mc:shitzu_develop
Closed

lint: wrap lines which include RegEx exceeding 80 chars#14607
thelostone-mc wants to merge 1 commit into
nodejs:masterfrom
thelostone-mc:shitzu_develop

Conversation

thelostone-mc commented Aug 3, 2017
edited by refack
Loading

Copy link
Copy Markdown
Contributor

Format commit wrapping lines containing RegEx and exceeding 80
chars.

Fixes: #14586

Files Changed:

  • test/addons-napi/test_properties/test.js
  • test/parallel/test-process-versions.js
  • test/parallel/test-repl.js
  • test/parallel/test-v8-serdes.js
  • test/parallel/test-whatwg-url-properties.js
  • test/parallel/test-zlib-not-string-or-buffer.js
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

nodejs-github-bot added node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests. labels Aug 3, 2017
Comment thread test/parallel/test-repl.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
  1. There are some RegExps with the same pattern which are left unchanged (lines 193, 198, 203 etc).

  2. It seems the \b symbol after the ^ is unneeded.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@vsemozhetbyt

  1. Well I tried that. On introducing a ^ in L193 which uses strict mode, I get the Octal literals are not allowed in strict mode error as below: (Same case as in other lines you had mentioned )
Unix data: "(function() { \"use strict\"; return 0755; })()\n 
^^^^\n\nSyntaxError: Octal literals are not allowed in strict mode.\n\nnode via Unix socket> node via Unix socket> ", expecting /^SyntaxError: Octal literals are not allowed in strict mode/
assert.js:42
  1. Yeah makes sense. Will do that! Can I go ahead and remove the\b even where I can't introduce a ^ cause of strict mode ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
  1. Oh, sorry, I did not think this broke matching.

  2. I think that removing the \b is safe only if we place ^ before)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ack and taken care of ^_^

refack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

💯 on the wrapping!

Comment thread test/parallel/test-v8-serdes.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: Now the whole thing would fit in a single line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@thefourtheye True! But doesn't it look cleaner this way ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm with @thefourtheye, also could drop the () => { } to get:

assert.throws(v8.Serializer, serializerTypeError);

Now that's clean ✨

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Well two against one !! Ack and taken care

Comment thread test/parallel/test-repl.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit \b -> ^?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

(And below two instances too?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It seems this somehow breaks matching: #14607 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some error messages quote erroneous code before the error message itself, so for these messages, we can't use ^ anchor (or we should add the /m flag beside).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK, then \b it is!

Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM if CI is green.

Copy link
Copy Markdown
Contributor

vsemozhetbyt commented Aug 3, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

One aix fail in CI seems unrelated (parallel/test-async-wrap-getasyncid is crashed).

Trott commented Aug 3, 2017

Copy link
Copy Markdown
Member

One aix fail in CI seems unrelated (parallel/test-async-wrap-getasyncid is crashed).

Yes, that's a known-flaky on that platform: #14599

@refack and possibly others are investigating.

CI is effectively green for this. 🎉

refack self-assigned this Aug 3, 2017
Format commit wrapping lines containing RegEx and exceeding 80
chars.

Fixes: nodejs#14586

vsemozhetbyt commented Aug 4, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

CI failures seem unrelated.

refack pushed a commit to refack/node that referenced this pull request Aug 7, 2017
Format commit wrapping lines containing RegEx and exceeding 80
chars.

PR-URL: nodejs#14607
Fixes: nodejs#14586
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

refack commented Aug 7, 2017

Copy link
Copy Markdown
Contributor

Landed in ad664ea
Turned out nice if I may say so myself.

refack closed this Aug 7, 2017
addaleax pushed a commit that referenced this pull request Aug 10, 2017
Format commit wrapping lines containing RegEx and exceeding 80
chars.

PR-URL: #14607
Fixes: #14586
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
addaleax mentioned this pull request Aug 13, 2017

Copy link
Copy Markdown
Contributor

This does not land cleanly in LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported

refack removed their assignment Oct 20, 2018
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

Labels

node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint: wrap long lines that include RegExp when possible

7 participants


Back | FazBrowse Home | New Git URL